/* ============================================================
   붕어빵 스킨 시스템 v2 (2026-08-04 디자이너 패스) — 서비스마다 ACCENT 토큰만 바꾼다.
   구조/컴포넌트 스타일은 아래 공통부이며 원칙적으로 수정하지 않는다.
   재생성: factory/gen-restyle.js (액센트 2토큰 주입) — 손수정 금지.
   ============================================================ */
:root {
  --accent: #b91c1c;
  --accent-strong: #991b1b;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --ink: #16181d;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 720px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px -4px rgba(16,24,40,.06);
  --shadow-pop: 0 2px 4px rgba(16,24,40,.06), 0 12px 28px -8px rgba(16,24,40,.12);
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  --ease: cubic-bezier(.2,.7,.3,1);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Segoe UI', 'Malgun Gothic', sans-serif;
}
[data-theme="dark"] {
  --bg: #101216;
  --surface: #17191f;
  --surface-2: #1c1f26;
  --ink: #e7e9ee;
  --muted: #98a2b3;
  --line: #262a33;
  --line-strong: #343a46;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -6px rgba(0,0,0,.5);
  --shadow-pop: 0 2px 6px rgba(0,0,0,.5), 0 16px 32px -8px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #101216;
    --surface: #17191f;
    --surface-2: #1c1f26;
    --ink: #e7e9ee;
    --muted: #98a2b3;
    --line: #262a33;
    --line-strong: #343a46;
    --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -6px rgba(0,0,0,.5);
    --shadow-pop: 0 2px 6px rgba(0,0,0,.5), 0 16px 32px -8px rgba(0,0,0,.6);
  }
}

/* ---------- 공통부 (수정 금지 영역) ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] { color-scheme: dark; } }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--accent);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* 헤더 — 스티키 + 블러, 얇은 경계 */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
@media (min-width: 760px) {
  .site-header { padding: 10px max(20px, calc((100% - var(--maxw)) / 2)); }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -0.02em; min-width: 0; flex: 1 1 auto; margin-right: 8px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.header-actions { display: flex; align-items: center; flex: 0 0 auto; }
.header-actions button,
.header-actions a.home-btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  background: none; border: 1px solid transparent; border-radius: 9px;
  color: var(--muted); font-size: 16px; width: 34px; height: 34px;
  cursor: pointer; margin-inline-start: 4px; text-decoration: none;
  transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease);
}
.header-actions button:hover,
.header-actions a.home-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.header-actions .lang-select {
  background: none; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); font-family: inherit; font-size: 13px;
  height: 34px; max-width: 118px; padding: 0 8px; cursor: pointer;
  transition: border-color .16s var(--ease);
}
.header-actions .lang-select:hover { border-color: var(--line-strong); }
.header-actions .lang-select:empty { display: none; }

main { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px 72px; }

/* 브레드크럼 스트립 (gen-crumbs-strip) */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 14px 0 0; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumb-sep { opacity: .55; }
.crumbs .crumb-cat {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 35%, var(--line));
  color: color-mix(in srgb, var(--cat, var(--accent)) 80%, var(--ink));
  background: color-mix(in srgb, var(--cat, var(--accent)) 7%, var(--surface));
  border-radius: 999px; padding: 3px 11px; font-weight: 600;
}
.crumbs .crumb-cat:hover { border-color: var(--cat, var(--accent)); color: var(--cat, var(--accent)); }
.crumb-cur { color: var(--ink); font-weight: 600; }

/* 히어로 — 좌측 정렬 에디토리얼 타이포 (2026-08-22 v3: 랜딩페이지식 중앙정렬 탈피) */
.hero { text-align: start; padding: 30px 0 6px; }
.hero h1 {
  font-size: clamp(27px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.18;
  margin: 0 0 10px;
}
.hero .lede { color: var(--muted); font-size: 16.5px; line-height: 1.6; margin: 0; max-width: 56ch; }

/* 도구 카드 — 레이어드 섀도 */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
  margin: 26px 0;
  box-shadow: var(--shadow-card);
}
.placeholder-note { color: var(--muted); text-align: center; }

/* 폼 위젯 — 표면 위 입력, 부드러운 포커스 링 */
.tool-card label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); margin: 16px 0 6px; letter-spacing: -0.005em; }
.tool-card input[type="text"], .tool-card input[type="number"],
.tool-card input[type="date"], .tool-card input[type="time"],
.tool-card input[type="datetime-local"], .tool-card input[type="email"],
.tool-card input[type="search"], .tool-card input[type="tel"],
.tool-card select, .tool-card textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
}
.tool-card input:hover, .tool-card select:hover, .tool-card textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.tool-card input:focus, .tool-card select:focus, .tool-card textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.tool-card ::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.tool-card select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23868e9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.tool-card textarea { appearance: auto; -webkit-appearance: auto; }
/* 포커스된 필드의 라벨 강조 */
.tool-card div:has(> input:focus) > label,
.tool-card div:has(> select:focus) > label,
.tool-card div:has(> textarea:focus) > label { color: var(--accent); }
.tool-card input[type="radio"], .tool-card input[type="checkbox"] { width: 17px; height: 17px; }

/* 버튼 — 확실한 프라이머리, 물리적 프레스 */
.btn {
  display: inline-block; padding: 13px 24px; font-size: 15.5px; font-weight: 700;
  font-family: inherit; letter-spacing: -0.005em;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--accent); color: #fff; margin-top: 20px;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), inset 0 1px 0 rgba(255,255,255,.12);
  transition: background-color .16s var(--ease), transform .08s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover { background: var(--accent-strong); box-shadow: 0 2px 6px rgba(16,24,40,.16), inset 0 1px 0 rgba(255,255,255,.12); }
.btn:active { transform: translateY(1px) scale(.995); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring), 0 1px 2px rgba(16,24,40,.1); }

/* 결과 — 좌측 액센트 바, 수치는 tabular */
.result {
  margin-top: 22px; padding: 18px 18px 18px 20px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-inline-start: 3px solid var(--accent);
  font-size: 16.5px;
  font-variant-numeric: tabular-nums;
}
.result strong { font-size: 22px; letter-spacing: -0.01em; color: var(--accent-strong); }
[data-theme="dark"] .result strong,
[data-theme="auto"] .result strong { color: var(--accent); }
#tool .rc-val { font-variant-numeric: tabular-nums; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result:not([hidden]), #result:not([hidden]) { animation: fadeUp .28s var(--ease); }
#tool .err:not([hidden]), #tool .error:not([hidden]) {
  border-inline-start: 3px solid #dc2626; padding: 8px 12px; border-radius: 8px;
  background: color-mix(in srgb, #dc2626 6%, var(--surface));
  animation: fadeUp .2s var(--ease);
}

.ad-slot { margin: 24px 0; min-height: 0; text-align: center; }

/* 가이드(심화) — 에디토리얼 리듬 */
.guide-content { margin-top: 44px; }
.guide-content h2 {
  font-size: 21px; letter-spacing: -0.02em; line-height: 1.35;
  margin: 40px 0 12px; padding-top: 26px;
  border-top: 1px solid var(--line);
}
.guide-content h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.guide-content h3 { font-size: 17px; letter-spacing: -0.015em; margin: 26px 0 8px; }
.guide-content p, .guide-content li { color: color-mix(in srgb, var(--ink) 86%, var(--muted)); font-size: 15.5px; line-height: 1.75; }
.guide-content table { border-collapse: collapse; font-size: 14.5px; }
.guide-content th, .guide-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: start; }
.guide-content th { background: var(--surface-2); font-weight: 650; }

/* 출처 블록 (2026-08-15 E-E-A-T 인용) */
.sources { margin-top: 36px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.sources h2 { font-size: 15px; letter-spacing: -0.01em; margin: 0 0 10px; }
.sources ul { margin: 0; padding-inline-start: 20px; }
.sources li { font-size: 14px; color: var(--muted); margin: 6px 0; line-height: 1.55; }
.sources a { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); text-decoration: underline; text-underline-offset: 2px; }
.sources a:hover { color: var(--accent); }

/* FAQ — 디바이더 리스트 + 회전 셰브런 */
.faq h2 { font-size: 20px; margin: 44px 0 10px; letter-spacing: -0.02em; }
.faq details {
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 2px 0; margin: 0;
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  font-weight: 600; font-size: 15.5px; cursor: pointer;
  padding: 14px 28px 14px 2px; position: relative; list-style: none;
  transition: color .16s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq summary:hover { color: var(--accent-strong); }
[data-theme="dark"] .faq summary:hover, [data-theme="auto"] .faq summary:hover { color: var(--accent); }
.faq p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 16px; padding-right: 20px; }

/* 관련 도구 — 살아있는 타일 */
.related h2 { font-size: 17px; letter-spacing: -0.015em; margin: 44px 0 12px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.related-item {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
  padding: 11px 13px; color: var(--ink); font-size: 14px; font-weight: 550;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.related-item:hover {
  text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-card); transform: translateY(-1px);
}
.related-ico { font-size: 17px; }

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 22px 20px 26px; margin-top: 48px;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 480px) {
  .header-actions .lang-select { max-width: 84px; }
  .tool-card { padding: 20px 16px; }
  .btn { width: 100%; text-align: center; }
  #ux-example { width: 100%; margin: 10px 0 0 !important; text-align: center; }
  .hero { padding-top: 26px; }
}

/* 접근성·인터랙션 기본기 */
:where(a, button, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (pointer: coarse) {
  .header-actions button,
  .header-actions a.home-btn { width: 44px; height: 44px; }
  .header-actions .lang-select { height: 44px; }
  .btn { min-height: 48px; }
  .faq summary { padding-top: 12px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 공용 유틸 */
.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;
}
.hint { color: var(--muted); font-size: 13.5px; margin-top: 8px; }

/* ux-print — 인쇄 시 도구·결과만 남긴다 */
@media print {
  .site-header, .site-footer, .related, .ad-slot, .faq, .guide-content, #ux-share, #ux-example, .header-actions { display: none !important; }
  body { background: #fff; }
  .hero { padding: 8px 0; }
}

/* ── v3.1 트렌드 패스 (2026-08-25) — 다크 카드 톱 하이라이트·프레스 피드백 ── */
[data-theme="dark"] .tool-card { box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.045); }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .tool-card { box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.045); }
}
.related-item:active { transform: translateY(0) scale(.99); }
