/* ChatGPT 먹통 자가진단(#1945). 형제 도구(sanji-check) 틀을 따르고 색만 차가운 회색 + 석유색 강조 하나.
 * 상태는 표가 아니라 선·색·배경으로: 단계 왼쪽 선(지금 할 단계 = 강조색 굵은 선, 끝낸 단계 = 완료 색 선 + 옅은 배경), 위쪽 진행 띠.
 * 한글 시스템 글꼴 + "Noto Sans KR" 폴백 */
:root {
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --bg: #f2f4f7; --paper: #fcfdfe; --ink: #141a22; --ink-2: #4c5664; --line: #d5dbe3;
  --accent: #0d5c6e; --accent-ink: #fcfdfe; --accent-soft: #e0eef1;
  --done: #2b7a4b; --done-soft: #e5f3ea;
  --warn: #9a5d0a; --warn-soft: #fbf0dc;
  --radius: 14px; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1318; --paper: #161c23; --ink: #e6ebf1; --ink-2: #a4afbd; --line: #2b3440;
    --accent: #6cc3d5; --accent-ink: #0b171b; --accent-soft: #15303a;
    --done: #6fd194; --done-soft: #16301f;
    --warn: #f0b552; --warn-soft: #3a2c12; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; overflow-x: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.skip { position: absolute; left: -999px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; } .skip:focus { left: 8px; top: 8px; background: var(--paper); z-index: 9; }
[hidden] { display: none !important; }
.wrap, .hero, .foot { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.hero { padding-top: 28px; padding-bottom: 4px; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 700; font-size: 14px; }
h1 { font-size: clamp(24px, 6vw, 34px); line-height: 1.3; margin: 6px 0 10px; letter-spacing: -0.02em; }
.lede { margin: 0; color: var(--ink-2); max-width: 44em; }
.asof { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
h2 { font-size: 18px; margin: 0 0 12px; line-height: 1.4; scroll-margin-top: 16px; }
h1, h2, h3 { text-wrap: balance; }
h2:focus { outline: none; }
.panel, .guide { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.sub { margin: -4px 0 12px; color: var(--ink-2); font-size: 15px; }
.muted { color: var(--ink-2); font-size: 14px; margin: 8px 0 0; }
.muted:empty { display: none; }
.nojs { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--warn); font-size: 14px; color: var(--ink-2); }
button, textarea, input, select { font: inherit; font-size: 16px; }
a { color: var(--accent); }
button:focus-visible, summary:focus-visible, a:focus-visible, textarea:focus-visible, input[type="text"]:focus-visible, input[type="search"]:focus-visible,
.opt:focus-within, .chip:focus-within, .step-check:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 1. 장애 확인: 맨 먼저 보는 칸이라 위쪽 굵은 강조선 */
.panel.first { border-top: 6px solid var(--accent); }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.status-list li { display: grid; grid-template-columns: 6.5em 1fr; gap: 2px 12px; align-items: center; padding: 8px 0 8px 12px; border-left: 4px solid var(--accent); }
.status-list li.st-none { border-left-color: var(--line); }
.st-name { font-weight: 800; grid-row: span 2; }
.st-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; justify-self: start; }
.st-what { font-size: 14px; color: var(--ink-2); }
.st-what a { display: inline-flex; align-items: center; min-height: 44px; }
.status-list li.st-none .st-what { grid-row: span 2; }

/* 2. 고르기 */
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--paper); }
.opt input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.opt small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 22px; cursor: pointer; background: var(--paper); }
.chip input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* 해결 순서: 진행 띠 + 단계마다 왼쪽 선 */
.plan { border-left: 8px solid var(--accent); }
.plan.all-done { border-left-color: var(--done); background: linear-gradient(var(--done-soft), var(--paper) 160px); }
.v-kicker { margin: 0; font-size: 14px; color: var(--ink-2); }
.plan h2 { font-size: 22px; margin: 2px 0 4px; }
.progress { margin: 0 0 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.track { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 4px; }
.track li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.track li.done { background: var(--done); }
.track li.now { background: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.step { counter-increment: st; padding: 6px 12px 10px 14px; border-left: 4px solid var(--line); border-radius: 0 10px 10px 0; }
.step.now { border-left: 6px solid var(--accent); background: var(--accent-soft); }
.step.done { border-left-color: var(--done); background: var(--done-soft); }
.step-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 0; cursor: pointer; font-weight: 700; }
.step-check input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--done); }
.step-check .t::before { content: counter(st) ". "; color: var(--ink-2); font-weight: 600; }
.step.done .step-check .t { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--done); }
.step-body { margin: 0 0 6px 36px; font-size: 15px; }
.step.done .step-body { color: var(--ink-2); }
.step-warn { margin: 0 0 6px 36px; padding: 6px 10px; border-left: 4px solid var(--warn); background: var(--warn-soft); font-size: 14px; border-radius: 0 8px 8px 0; }
.step-src { margin: 0 0 0 36px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; column-gap: 12px; align-items: center; }
.step-src a { display: inline-flex; align-items: center; min-height: 44px; }
.step-jump { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.field > label, .field legend, .lbl { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 6px; }
.field input[type="text"], .field input[type="search"] { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--ink-2); border-radius: 10px; background: var(--paper); color: var(--ink); -webkit-appearance: none; appearance: none; }
.help { margin: 0; font-size: 13px; color: var(--ink-2); }
.hint { color: var(--ink); font-weight: 600; }
.hint:empty { display: none; }
.fields { display: grid; grid-template-columns: 1fr; gap: 0 16px; }

/* 3. 오류 문구 */
.err-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.err-list li { border-left: 4px solid var(--line); background: var(--bg); border-radius: 0 10px 10px 0; }
.err-list li:has(details[open]) { border-left-color: var(--accent); }
.err-list summary { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 48px; padding: 8px 12px; cursor: pointer; }
.err-text { font-weight: 700; overflow-wrap: anywhere; }
.err-ko { font-size: 14px; color: var(--ink-2); }
.err-where { font-size: 13px; color: var(--accent); font-weight: 700; }
.err-list details > p { margin: 0 12px 8px; font-size: 15px; }
.err-list b { display: inline-block; min-width: 2.6em; color: var(--ink-2); }
.err-adv { padding: 6px 10px; border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 0 8px 8px 0; }
.err-src { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; column-gap: 12px; align-items: center; }
.err-src a { display: inline-flex; align-items: center; min-height: 44px; }
.err-src .src-i { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.err-src .sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 4. 문의 */
.howto { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 10px; }
.howto strong { display: block; }
.howto span { display: block; color: var(--ink-2); font-size: 15px; }
.howto .ext, .howto span a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.warn-line { margin: 0 0 14px; padding: 8px 12px; border-left: 4px solid var(--warn); background: var(--warn-soft); font-size: 14px; border-radius: 0 8px 8px 0; }
.warn-line:empty { display: none; }
.msg { display: block; width: 100%; min-width: 0; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; resize: vertical; }
.btn { min-height: 48px; padding: 10px 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; width: 100%; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); font-weight: 600; margin-top: 8px; }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.08); }
  .opt:hover, .chip:hover { border-color: var(--accent); }
}

/* 기기별 전체 단계·질문·출처 */
.dev-all { border-top: 1px solid var(--line); }
.dev-all > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.all-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.all-steps strong { display: block; }
.all-steps span { color: var(--ink-2); font-size: 14px; }
.src-list { margin: 0; padding-left: 20px; }
.src-list a { display: inline-flex; align-items: center; min-height: 44px; }
.guide details.faq { border-top: 1px solid var(--line); padding: 4px 0; }
.guide summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.guide details.faq p { margin: 0 0 10px; color: var(--ink-2); }
.disclaimer { margin: 8px 0 24px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.foot { padding-bottom: 32px; font-size: 14px; color: var(--ink-2); }
.foot p { margin: 0 0 4px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* 넓은 화면(1280px 이상)에서만 두 칸. 1279px 까지는 한 칸(갤럭시 폴드 펼침·카톡 인앱 포함) */
@media (min-width: 1280px) {
  .wrap, .hero, .foot { max-width: 1180px; }
  .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
}
@media (min-width: 600px) and (max-width: 1279px) {
  .opts { grid-template-columns: 1fr 1fr; }
  .seg { grid-template-columns: 1fr 1fr 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .btn { width: auto; min-width: 220px; }
}
@media (max-width: 380px) {
  .status-list li { grid-template-columns: 1fr; }
  .st-name, .status-list li.st-none .st-what { grid-row: auto; }
  .step-body, .step-warn, .step-src { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) { .opt, .chip, .step, .track li { transition: border-color .15s, background-color .15s, color .15s; } }
