/* 따뜻한 종이 느낌: 아이보리 배경, 먹색 글자, 얇은 테두리 카드(그림자 없음), 테라코타 포인트.
   글꼴은 Pretendard 하나만 쓰고, 제목은 굵기(800)와 좁은 자간으로 구분한다. 개발자용은 포인트 색만 청록. */
:root {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #fffdf9;
  --text: #2b2622;
  --sub: #5c544c;
  --muted: #6f665d;
  --line: #e6ded3;
  --line-strong: #d4c9bb;
  --accent: #c2532d;
  --accent-dark: #9e3f1f;
  --accent-bg: #f6e6de;
  --on-accent: #ffffff;
  --good: #2f6b3a;
  --good-bg: #e3efe0;
  --warn: #8a6100;
  --warn-bg: #f7edd3;
  --ink: #2b2622;
  --on-ink: #faf7f2;
  --red: #b3261e;
  --radius: 12px;
}

/* 다크 모드: 기기 설정을 따르되, 상단 버튼으로 고른 값(data-theme)이 있으면 그걸 쓴다. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1714;
    --surface: #23201c;
    --text: #ede6dc;
    --sub: #c4baae;
    --muted: #a39789;
    --line: #3a342e;
    --line-strong: #4a433b;
    --accent: #e07a55;
    --accent-dark: #f09a78;
    --accent-bg: #3a2419;
    --on-accent: #1a1714;
    --good: #8fcb98;
    --good-bg: #1f3022;
    --warn: #e3b341;
    --warn-bg: #33290f;
    --ink: #ede6dc;
    --on-ink: #1a1714;
    --red: #ff8a80;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1714;
  --surface: #23201c;
  --text: #ede6dc;
  --sub: #c4baae;
  --muted: #a39789;
  --line: #3a342e;
  --line-strong: #4a433b;
  --accent: #e07a55;
  --accent-dark: #f09a78;
  --accent-bg: #3a2419;
  --on-accent: #1a1714;
  --good: #8fcb98;
  --good-bg: #1f3022;
  --warn: #e3b341;
  --warn-bg: #33290f;
  --ink: #ede6dc;
  --on-ink: #1a1714;
  --red: #ff8a80;
}

/* 개발자용 포인트 색 (청록) */
/* 개발자용: 배경을 푸른 회색 계열로 바꿔 비개발자용(아이보리)과 한눈에 구분. 포인트 색은 청록 */
body[data-mode="dev"] {
  --bg: #eef4f3;
  --surface: #fbfdfd;
  --text: #1f2a29;
  --sub: #4b5957;
  --muted: #5d6c69;
  --line: #d6e2e0;
  --line-strong: #bfd0cd;
  --accent: #1f6f6b;
  --accent-dark: #17524f;
  --accent-bg: #dcecea;
  --ink: #1f2a29;
  --on-ink: #eef4f3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-mode="dev"] {
    --bg: #111816;
    --surface: #18211f;
    --text: #e3ece9;
    --sub: #b5c4c0;
    --muted: #93a39f;
    --line: #2a3633;
    --line-strong: #384744;
    --accent: #5fb8b0;
    --accent-dark: #86cdc6;
    --accent-bg: #17302d;
    --ink: #e3ece9;
    --on-ink: #111816;
  }
}
:root[data-theme="dark"] body[data-mode="dev"] {
  --bg: #111816;
  --surface: #18211f;
  --text: #e3ece9;
  --sub: #b5c4c0;
  --muted: #93a39f;
  --line: #2a3633;
  --line-strong: #384744;
  --accent: #5fb8b0;
  --accent-dark: #86cdc6;
  --accent-bg: #17302d;
  --ink: #e3ece9;
  --on-ink: #111816;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--accent); text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }
/* 홈 타일, 결과 카드, 상세 2단은 넓게 쓴다. 용어집·변경 이력은 .narrow로 읽기 좋은 폭 */
body.wide .container { max-width: 1072px; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---- 예시 데이터 띠 ---- */
/* 예시 데이터 화면: 배경은 그대로 두고, 노란 줄무늬 띠 + 상단 바 아래 노란 선 + 로고 옆 "예시" 표시로 구분 */
.demo-banner {
  background: repeating-linear-gradient(-45deg, #f5c84c 0 12px, #efbb2f 12px 24px);
  color: #2b2622;
  text-align: center;
  font-size: 0.875rem;
  padding: 6px 16px;
}
body.is-demo .topbar { border-bottom: 3px solid #e0a91a; }
body.is-demo .logo::after {
  content: "예시";
  background: #f5c84c;
  color: #2b2622;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
}
/* 개발자용은 로고가 길어서 좁은 화면에서는 "예시" 표시를 빼고 띠·노란 선으로만 구분 */
@media (max-width: 420px) {
  body.is-demo[data-mode="dev"] .logo::after { display: none; }
}

/* ---- 상단 바 ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; white-space: nowrap; }
.logo-tag { background: var(--accent-bg); color: var(--accent-dark); border-radius: 6px; padding: 1px 7px; font-size: 0.875rem; font-weight: 700; letter-spacing: 0; }

main { padding-bottom: 48px; }

/* ---- 제목 ---- */
h1, h2, h3 { letter-spacing: -0.02em; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.9rem; margin: 0 0 8px; }
.intro-what h1, .page-title {
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 800;
  margin: 0;
}
.intro-what .sub, .page-sub { color: var(--sub); font-size: 1.05rem; margin: 12px 0 0; }

/* ---- 홈 소개: 카드 하나, 안을 칸으로 나눈다 (한 화면에 들어가게).
   칸 사이 1px 틈으로 카드 배경(선 색)이 보여서 구분선이 된다. ---- */
.card.intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  margin: 20px 0 28px;
  overflow: hidden;
  background: var(--line);
}
.intro-part { background: var(--surface); padding: 16px; }
.intro-what { grid-column: 1 / -1; }
.intro-go { margin-top: 14px; padding: 10px 18px; min-height: 44px; }
.intro-how, .intro-stats { grid-column: 1 / -1; }
.intro-title { font-size: 0.95rem; font-weight: 800; margin: 0 0 8px; }
.intro-steps { list-style: none; counter-reset: istep; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.intro-steps li { counter-increment: istep; font-size: 0.9rem; font-weight: 600; line-height: 1.45; }
.intro-steps li::before {
  content: counter(istep);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 800;
}
.intro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.intro-list li { position: relative; padding-left: 18px; font-size: 0.9rem; line-height: 1.5; }
.intro-list li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
.intro-trust li::before { content: "✓"; left: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); line-height: 1.3; }
.stat-label { font-size: 0.875rem; color: var(--muted); }
@media (min-width: 900px) {
  .card.intro { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; }
  .intro-part { padding: 22px; }
  .intro-what { grid-column: span 2; }
  .intro-how { grid-column: auto; }
  .intro-stats { grid-column: auto; }
  .intro-steps { grid-template-columns: 1fr; gap: 10px; }
  .intro-steps li { display: flex; align-items: center; gap: 10px; }
  .intro-steps li::before { flex: none; margin: 0; }
}
.page-head { padding: 24px 0 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.back:hover { color: var(--sub); }
.step { color: var(--accent); font-weight: 700; font-size: 0.9rem; margin: 0 0 6px; }
.section-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 12px; }

/* ---- 카드 ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 16px; }
.card-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }

/* ---- 실제 데이터가 없을 때 안내 ---- */
.invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--accent-bg); border-color: transparent; }
.invite-text { margin: 0; flex: 1 1 320px; color: var(--sub); }
.invite-text strong { color: var(--text); }
.invite .btn { flex: none; background: var(--surface); }


/* ---- 홈: 목적 타일 ("처음이라면" 표시는 modes.js starters) ---- */
.purposes { margin-bottom: 28px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
}
.tile-flag { align-self: flex-start; margin-bottom: 2px; background: var(--accent-bg); color: var(--accent-dark); border-radius: 6px; padding: 1px 8px; font-size: 0.875rem; font-weight: 700; }
.tile:hover { border-color: var(--accent); }
.tile:hover .tile-ttl { color: var(--accent); }
.tile-ico { font-size: 1.6rem; line-height: 1.2; margin-bottom: 4px; }
.tile-ttl { font-weight: 800; font-size: 1rem; line-height: 1.4; letter-spacing: -0.02em; }
.tile-dsc { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---- 리스트 행 ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 0;
  color: inherit;
}
.row:hover .ttl { color: var(--accent); }
.row:focus-visible { border-radius: 6px; }
.row .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 1.3rem;
}
.row .txt { flex: 1; min-width: 0; }
.row .ttl { display: block; font-weight: 700; font-size: 1.05rem; }
.row .dsc { display: block; color: var(--muted); font-size: 0.92rem; }
.row .chev { flex: none; color: var(--muted); font-size: 1.3rem; }

/* 홈 "더 알아보기": 넓은 화면은 2칸 */
.more-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.more-links .row { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.more-links .row:hover { border-color: var(--accent); }
@media (min-width: 560px) { .more-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- 버튼 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 1rem;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: var(--accent-bg); }
.btn-block { width: 100%; }

/* ---- 칩 (결과 화면에서 조건 바꾸기) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.chips-label { width: 100%; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--sub);
  font-weight: 600;
  font-size: 0.92rem;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chips-desc { width: 100%; margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }

/* ---- 안내 띠 ---- */
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 12px 16px; font-weight: 700; margin: 0 0 16px; }
.notice::before { content: "⚠ "; }
.unknown { color: var(--warn); font-weight: 700; }

/* ---- 배지 (무료·학습 정책·한국어 등 한눈에 보기) ---- */
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.badge { border-radius: 999px; padding: 3px 10px; font-size: 0.875rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-plain { border-color: var(--line-strong); color: var(--sub); }

/* ---- 추천 카드: 휴대폰은 세로로 쌓고, 넓은 화면(900px 이상)은 3개를 나란히 ---- */
.cards { display: grid; gap: 12px; }
.tool-card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
}
@media (min-width: 900px) {
  .cards {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 340px);
    /* 카드 안 칸(머리, 대표 이유, 배지, 버튼, 자세히 보기)을 카드끼리 같은 높이로 맞춘다 (app.js toolCardHtml) */
    grid-template-rows: repeat(5, auto);
    justify-content: center;
    column-gap: 16px;
    row-gap: 0;
    align-items: start;
  }
  .cards:has(> .tool-card:only-child) { grid-auto-columns: minmax(0, 420px); }
  .tool-card { grid-row: span 5; grid-template-rows: subgrid; }
}
.tool-head { padding-bottom: 12px; }
.tool-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tool-name { font-size: 1.3rem; font-weight: 800; margin: 0; }
.tool-name a { color: inherit; }
.tool-name a:hover { color: var(--accent); }
.tool-one-liner { color: var(--sub); margin: 6px 0 0; font-size: 0.95rem; }
.tag { border-radius: 6px; padding: 2px 8px; font-size: 0.875rem; font-weight: 700; white-space: nowrap; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-plain { border: 1px solid var(--line-strong); color: var(--sub); }

.top-reason {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.tool-card .badges { padding-bottom: 14px; }
.tool-actions { align-self: end; }

.card-more { margin-top: 12px; border-top: 1px solid var(--line); }
.card-more > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0 2px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
}
.card-more > summary::-webkit-details-marker { display: none; }
.card-more > summary::after { content: " ▾"; }
.card-more[open] > summary::after { content: " ▴"; }
.card-more[open] > summary { padding-bottom: 10px; }
.card-more .reasons { padding-bottom: 6px; }
.card-more .section-label { margin-top: 16px; }
.card-more .sources { font-size: 0.875rem; }
.card-more-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 14px 0 0; font-size: 0.9rem; font-weight: 700; }

.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reasons li { font-size: 0.92rem; font-weight: 600; padding-left: 22px; position: relative; }
.reasons li::before { content: "●"; position: absolute; left: 4px; top: 0; color: var(--accent); font-size: 0.7rem; line-height: 2.1; }

.facts { margin-top: 4px; }
.fact { display: grid; grid-template-columns: 80px 1fr; gap: 8px; margin: 0; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.fact dd { margin: 0; }

.section-label { color: var(--muted); font-size: 0.875rem; font-weight: 700; margin: 0 0 8px; letter-spacing: 0; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; align-items: start; font-size: 0.95rem; }
.steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875rem;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.cautions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cautions li { background: var(--warn-bg); border-radius: 8px; padding: 7px 10px; font-size: 0.9rem; }
.cautions li::before { content: "⚠ "; color: var(--warn); font-weight: 700; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist li { font-size: 0.92rem; }
.check-yes > span[aria-hidden] { color: var(--good); font-weight: 800; }
.check-no { color: var(--muted); }
.more-candidates { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.more-candidates > summary { cursor: pointer; list-style: none; padding: 14px 0; color: var(--accent); font-weight: 700; text-align: center; min-height: 48px; }
.more-candidates > summary::-webkit-details-marker { display: none; }
.more-candidates > summary::after { content: " ▾"; }
.more-candidates[open] > summary::after { content: " ▴"; }
.more-candidates .list { border-top: 1px solid var(--line); }
.order-note { color: var(--muted); font-size: 0.875rem; margin: -8px 0 16px; }

.verified-line { margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; }


/* ---- 개발자용 추천 섹션 (공식 AI 툴 / 오픈소스) ---- */
.result-section + .result-section { margin-top: 32px; padding-top: 24px; border-top: 1px dashed var(--line-strong); }
.result-section-title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.result-section-desc { color: var(--muted); font-size: 0.92rem; margin: 2px 0 14px; }

/* ---- 툴 상세: 넓은 화면은 왼쪽 요약(고정) + 오른쪽 내용 ---- */
.detail { display: grid; gap: 0; }
.detail-summary .tool-title { gap: 10px; }
.detail-summary .tool-one-liner { margin: 8px 0 14px; }
.detail-summary .tool-actions { margin-top: 18px; }
.more-link { display: block; text-align: center; margin-top: 10px; font-weight: 700; font-size: 0.92rem; }
.card > .steps, .card > .cautions { margin-top: 12px; }
.card .section-label { margin-top: 16px; }
.sources { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.sources a { word-break: break-all; }

/* 휴대폰: "공식 사이트 열기"를 화면 아래에 고정 */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
body.has-sticky-cta { padding-bottom: 76px; }
@media (max-width: 899px) {
  .detail-summary .tool-actions .btn-primary { display: none; }
  .detail-summary .tool-actions .more-link { margin-top: 0; }
}
@media (min-width: 900px) {
  .detail { grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
  .detail-summary { position: sticky; top: 76px; }
  .sticky-cta { display: none; }
  body.has-sticky-cta { padding-bottom: 0; }
}

.empty { text-align: center; color: var(--muted); padding: 24px 0 8px; }
.empty strong { display: block; color: var(--text); font-weight: 800; font-size: 1.15rem; margin-bottom: 4px; }

.site-footer { color: var(--muted); font-size: 0.875rem; padding: 16px 16px 40px; border-top: 1px solid var(--line); margin-top: 8px; }
.site-terms { margin: 8px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.loading, .error { padding: 60px 0; color: var(--muted); }
.error { color: var(--red); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- 상단 메뉴 ---- */
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sub); font-weight: 600; font-size: 0.92rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="page"] { color: var(--accent); }
.theme-btn { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 1.05rem; line-height: 1; padding: 8px; border-radius: 8px; }
.theme-btn:hover { background: var(--accent-bg); }

/* ---- 변경 이력 ---- */
.change-list { list-style: none; margin: 8px 0 0; padding: 0; }
.change-list li { padding: 9px 0 9px 22px; position: relative; border-top: 1px solid var(--line); font-size: 0.95rem; }
.change-list li:first-child { border-top: 0; }
.change-list li::before { content: "·"; position: absolute; left: 6px; color: var(--muted); font-weight: 800; }
.change-list li.change-added::before { content: "+"; color: var(--accent); }
.change-list li.change-removed::before { content: "−"; color: var(--red); }
.change-list a { color: inherit; }
.change-list a:hover { color: var(--accent); }
.change-date { display: block; color: var(--muted); font-size: 0.875rem; }

/* ---- 용어: 문장 속 단어는 점선 밑줄, 비교 항목 이름은 작은 ⓘ ---- */
.term {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: help;
}
.term:hover { color: var(--accent); }
.term-icon {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1;
  padding: 2px;
  border-radius: 50%;
  vertical-align: 0;
  position: relative;
}
/* ⓘ는 작게 보이지만 누르는 범위는 손가락 크기(약 44px)로 넓힌다 */
.term-icon::after { content: ""; position: absolute; inset: -14px; }
.term-icon:hover { color: var(--accent); }
.term-sample { text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.term-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.term-sheet-inner {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(43, 38, 34, 0.18);
  padding: 18px 20px;
}
.term-sheet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.term-close { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 1rem; padding: 4px 8px; border-radius: 6px; }
.term-close:hover { background: var(--accent-bg); }
.term-sheet p { margin: 8px 0 12px; color: var(--sub); }
.term-sheet a { font-weight: 700; font-size: 0.92rem; }

/* 용어집: 용어마다 눌러서 펼치는 형식 */
.glossary { margin: 0; }
.glossary-item { border-top: 1px solid var(--line); scroll-margin-top: 120px; }
.glossary-item:first-child { border-top: 0; }
.glossary-item > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-height: 48px;
  padding: 12px 28px 12px 0;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.glossary-item > summary::-webkit-details-marker { display: none; }
.glossary-item > summary::after { content: "▾"; position: absolute; right: 4px; top: 12px; color: var(--muted); }
.glossary-item[open] > summary::after { content: "▴"; color: var(--accent); }
.glossary-item > summary:hover .glossary-term { color: var(--accent); }
.glossary-term { white-space: nowrap; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.glossary .alias { color: var(--muted); font-weight: 500; font-size: 0.875rem; letter-spacing: 0; }
.glossary-desc { margin: 0 0 14px; color: var(--sub); }
.glossary-item.focused { background: var(--accent-bg); margin: 0 -12px; padding: 0 12px; border-radius: 8px; }

/* "정보가 틀려요" 제보 링크 */
.report-link { font-weight: 700; }
.report { margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; }
.report-note { font-size: 0.875rem; }

@media (max-width: 560px) {
  .topnav a { padding: 6px 7px; font-size: 0.88rem; }
  .page-title { font-size: 1.65rem; }
  .card { padding: 20px 16px; }
  .card.intro { margin-top: 14px; }
  .intro .intro-part { padding: 12px 14px; }
  .intro-what h1 { font-size: 1.4rem; }
  .intro-what .sub { font-size: 0.95rem; margin-top: 6px; }
  .intro-go { margin-top: 10px; }
  .intro-title { margin-bottom: 6px; }
  /* 작은 휴대폰에서도 소개 카드가 한 화면에 들어가게 */
  .card.intro { margin-top: 10px; }
  .intro-what .eyebrow { display: none; }
  .intro-what .sub { line-height: 1.5; }
  .intro-steps li { display: flex; align-items: center; gap: 6px; }
  .intro-steps li::before { flex: none; margin: 0; width: 22px; height: 22px; }
  .intro-list { gap: 2px; }
  .intro-list li { line-height: 1.45; }
  .intro-stats .intro-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stat-num { font-size: 1.2rem; }
  .intro-steps { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 4px; }
  .intro-steps li { font-size: 0.875rem; white-space: nowrap; }
  /* 조건 칩: 좁은 화면은 2칸씩 가지런히 */
  .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips-label, .chips-desc { grid-column: 1 / -1; }
  .chip { justify-content: center; padding: 7px 10px; }
  .tool-card { padding: 18px 16px 14px; }
}
/* 아주 좁은 화면: 로고 옆 글자 메뉴가 넘치지 않게 줄인다 */
@media (max-width: 380px) {
  .logo { font-size: 1.02rem; }
  .topnav a { padding: 6px 5px; font-size: 0.875rem; }
}

/* 기기에서 "동작 줄이기"를 켠 사람에게는 움직임 없이 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
