/* 국선대리인·국선변호인 선임요건 자가진단(#2582).
 * Design read: 법률(YMYL) 자가진단, 폰·카톡 인앱의 일반인, trust-first. 다이얼 VARIANCE 4 · MOTION 3 · DENSITY 5.
 * 색: 참고 화면을 design-dna measure-colors.mjs 로 잰 값(FORGE/2582/kit/measured-colors.json) 바탕 #e9f2fd · 하늘 #bcd7fe · 주 색 #5e96f0.
 * 주 색은 흰 글자와 2.96:1 이라 글자가 얹히는 면·글자 색만 같은 색상의 짙은 파랑(--accent-strong, 6.5:1)으로 칠한다. 글자 색 --ink 는 파랑 계열 남색으로 파생.
 * 짜임(참고 화면): 파란 머리 띠 + 유리질감 바로가기 타일 → 상황 타일 5 · 시간 칸(슬롯) → 예/아니오 칸 · 상태 배지(ON-SITE/ONLINE) → 결과 배지 3종
 * · 흰 둥근 판이 머리 띠 위로 올라옴 · 단계 1→2→3 선이 진행에 따라 채워짐. 선례 /excel-crash/(보라·왼쪽 선 단계)와 색·카드 모양이 다르다.
 * 유리질감은 웹 근사(backdrop-filter)이고, 투명도 줄이기 설정이면 단색. 바깥 글꼴·파일 없음, 시스템 산세리프 + 한글 폴백. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  /* 잰 값 */
  --bg: #e9f2fd; --sky: #bcd7fe; --accent: #5e96f0;
  /* 파생(WCAG AA) */
  --paper: #fbfdff; --surface: #f2f7fe; --ink: #1d2b44; --ink-2: #4a5a74; --line: #cfdcf0;
  --accent-strong: #2559b5; --on-strong: #fbfdff; --focus: #2559b5;
  --hero: #2559b5; --hero-2: #1f4fa3; --on-hero: #fbfdff;
  --likely: #1c6b45; --likely-soft: #e2f4ea; --check: #875400; --check-soft: #fdf0d5; --unlikely: #a3343a; --unlikely-soft: #fbe5e6;
  --glass: rgba(251, 253, 255, .72); --glass-edge: rgba(255, 255, 255, .85);
  --shadow: 0 10px 30px rgba(37, 89, 181, .12); --shadow-sm: 0 4px 12px rgba(37, 89, 181, .10);
  --r: 24px; --r-md: 16px; --r-sm: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 800px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1626; --sky: #20345a; --paper: #16213a; --surface: #1b2945; --ink: #e7eefb; --ink-2: #aab8d0; --line: #2d4068;
    --accent-strong: #8db7ff; --on-strong: #0e1626; --focus: #8db7ff;
    --hero: #1d3f80; --hero-2: #173468; --on-hero: #f2f6fd;
    --likely: #7fdcab; --likely-soft: #133325; --check: #f3c26b; --check-soft: #3a2b0e; --unlikely: #ff9ea4; --unlikely-soft: #3d1a1d;
    --glass: rgba(22, 33, 58, .78); --glass-edge: rgba(141, 183, 255, .18);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-sm: 0 4px 12px rgba(0, 0, 0, .3);
  }
}
* { 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; word-break: keep-all; overflow-wrap: anywhere; caret-color: var(--accent-strong); }
::selection { background: var(--accent-strong); color: var(--on-strong); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; top: 8px; z-index: 9; background: var(--paper); color: var(--accent-strong); }
a { color: var(--accent-strong); text-underline-offset: 3px; }
button, input, textarea { font: inherit; font-size: 16px; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hero :focus-visible { outline-color: var(--on-hero); }
h2[tabindex]:focus { outline: none; }

/* 머리 띠: 짙은 파랑 면 + 유리 타일(참고 화면 왼쪽 앱의 바로가기 타일) */
.hero { background: linear-gradient(165deg, var(--hero) 0%, var(--hero-2) 100%); color: var(--on-hero); padding: 28px 0 76px; }
.hero-in, .layout, .sources, .foot { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
h1 { font-size: clamp(26px, 6.6vw, 40px); line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 800; }
.lede { margin: 0 0 22px; max-width: 40em; font-size: 16px; }
.pick h2 { font-size: 17px; margin: 0 0 10px; font-weight: 700; }
.nojs { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile:last-child { grid-column: span 2; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 104px; padding: 12px; text-align: left; cursor: pointer;
  color: var(--on-hero); background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .34); border-radius: var(--r-md);
  -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.tile .ico { width: 40px; height: 40px; padding: 7px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .16); flex: none; }
.tile-t { font-size: 16px; font-weight: 800; line-height: 1.3; }
.tile-t small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; }
.tile[aria-pressed="true"] { background: var(--paper); color: var(--accent-strong); border-color: var(--paper); }
.tile[aria-pressed="true"] .ico { background: var(--accent-strong); color: var(--on-strong); }
.tile[aria-pressed="true"] .tile-t small { color: var(--ink-2); }
.tile:active { transform: scale(.98); }

/* 흰 판이 머리 띠 위로 올라온다 */
.sheet { position: relative; margin-top: -44px; }
.layout { display: block; }
.card { background: var(--paper); border: 0; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 16px; margin: 0 0 16px; }
/* 질문·결과로 스크롤할 때 들어오는 움직임(translateY)만큼 윗변이 잘리지 않게 */
#ask, #result { scroll-margin-top: 16px; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }

/* 단계 선 1→2→3: 진행에 따라 선이 채워지고 원이 바뀐다 */
.stepper { position: relative; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 16px; padding: 14px 8px 12px; background: var(--paper); border: 0; border-radius: var(--r); box-shadow: var(--shadow); }
.stepper::before, .stepper::after { content: ""; position: absolute; top: 31px; left: 16.67%; right: 16.67%; height: 4px; border-radius: 2px; background: var(--sky); }
.stepper::after { background: var(--accent-strong); transform-origin: left center; transform: scaleX(0); }
.stepper[data-at="2"]::after { transform: scaleX(.5); }
.stepper[data-at="3"]::after { transform: scaleX(1); }
.stepper li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 600; text-align: center; }
.stepper b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sky); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stepper li.done b { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-strong); }
.stepper li.now b { background: var(--paper); border-color: var(--accent-strong); color: var(--accent-strong); box-shadow: 0 0 0 4px var(--sky); }
.stepper li.now { color: var(--ink); font-weight: 800; }

/* 이름이 헷갈려요 */
.names { padding: 6px 16px; }
.names summary { display: flex; flex-direction: column; justify-content: center; min-height: 60px; cursor: pointer; list-style: none; padding-right: 28px; position: relative; }
.names summary::-webkit-details-marker { display: none; }
.names summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); }
.names details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.names h2 { font-size: 17px; margin: 0; }
.sum-sub { font-size: 14px; color: var(--ink-2); }
.names-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.name-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.name-card h3 { font-size: 16px; margin: 0 0 6px; color: var(--accent-strong); }
.name-card dl { margin: 0; display: grid; gap: 4px; }
.name-card dl div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; font-size: 14px; }
.name-card dt { color: var(--ink-2); }
.name-card dd { margin: 0; }

/* 질문 */
.empty h2 { font-size: 18px; margin: 0 0 6px; }
.empty p { margin: 0; color: var(--ink-2); font-size: 15px; }
.ask-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.track-chip { display: inline-flex; align-items: center; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--sky); color: var(--ink); font-size: 14px; font-weight: 700; }
.qcount { margin: 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.qbar { height: 6px; margin: 12px 0 14px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.qbar span { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.intro { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); font-size: 15px; color: var(--ink-2); }
#h-ask { font-size: 21px; line-height: 1.45; margin: 0 0 6px; }
.qhelp { margin: 0 0 4px; color: var(--ink-2); font-size: 15px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.ans { min-height: 60px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 800; cursor: pointer; }
.ans:active { transform: scale(.98); }
.basis, .links { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.links-lead { flex-basis: 100%; }
.basis a, .links a { display: inline-flex; align-items: center; min-height: 44px; }
.answered { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.answered li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-2); }
.a-v { flex: none; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--surface); color: var(--ink-2); }
.answered li.yes .a-v { background: var(--sky); color: var(--ink); }
.nav-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn { flex: 1 1 140px; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 14px; background: var(--accent-strong); color: var(--on-strong); font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 600; }
.btn:active { transform: translateY(1px); }
#copy { flex-basis: 100%; }
#copy.copied { background: var(--likely); color: var(--paper); }
.fallback { display: block; margin: 12px 0 6px; font-size: 14px; color: var(--ink-2); }
.fallback-text { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }

/* 결과: 상태 배지(색 + 아이콘 + 글)와 결과 머리 배경이 상태 색으로 바뀐다(진행은 단계 선이 채워지며 보인다) */
.result { padding: 0; overflow: hidden; --lv: var(--accent-strong); --lv-soft: var(--sky); }
.result[data-level="likely"] { --lv: var(--likely); --lv-soft: var(--likely-soft); }
.result[data-level="check"] { --lv: var(--check); --lv-soft: var(--check-soft); }
.result[data-level="unlikely"] { --lv: var(--unlikely); --lv-soft: var(--unlikely-soft); }
.result-head { padding: 16px 16px 14px; background: linear-gradient(180deg, var(--lv-soft) 0%, var(--lv-soft) 40%, var(--paper) 100%); }
.status { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 8px 0; padding: 5px 12px 5px 8px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.status[data-level="likely"] { background: var(--likely-soft); color: var(--likely); box-shadow: inset 0 0 0 1.5px var(--likely); }
.status[data-level="check"] { background: var(--check-soft); color: var(--check); box-shadow: inset 0 0 0 1.5px var(--check); }
.status[data-level="unlikely"] { background: var(--unlikely-soft); color: var(--unlikely); box-shadow: inset 0 0 0 1.5px var(--unlikely); }
.status-ico { display: inline-flex; }
#h-result { font-size: 22px; line-height: 1.4; margin: 10px 0 8px; }
.why { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.decider { margin: 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--paper); font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm); }
.res-body { padding: 4px 16px 0; display: grid; gap: 12px; }
.blk { margin: 0; }
.blk h3 { font-size: 16px; margin: 8px 0 4px; }
.blk p, .blk ul, .blk ol { margin: 0; font-size: 15px; }
.blk ul { padding-left: 20px; display: grid; gap: 4px; }
.caution { padding: 4px 14px 12px; border-radius: var(--r-md); background: var(--surface); }
.caution h3 { color: var(--accent-strong); }
.mine summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; }
.mine .answered { margin-top: 0; }
.alt ul { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.alt button, .alt a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; min-height: 56px; padding: 8px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; font-size: 15px; }
.alt button b, .alt a { font-weight: 700; }
.alt button span { font-size: 13px; color: var(--ink-2); }
.alt a { color: var(--accent-strong); }
.alt-note { margin: 4px 2px 0; font-size: 13px; color: var(--ink-2); }
.result .nav-row { padding: 0 16px; }
.result > .sr-only + .fallback, .result .fallback-text { margin-left: 16px; margin-right: 16px; width: calc(100% - 32px); }
.result::after { content: ""; display: block; height: 16px; }

/* 알아 둘 것·출처 */
.notice h2 { font-size: 17px; margin: 0 0 6px; }
.notice ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.notice b { color: var(--ink); }
.sources { padding-top: 8px; padding-bottom: 8px; }
.sources h2 { font-size: 17px; margin: 8px 0 6px; }
.src-list { margin: 0; padding-left: 20px; font-size: 14px; }
.src-org { color: var(--ink-2); }
.src-list a { display: inline-flex; align-items: center; min-height: 44px; }
.asof { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.foot { padding-top: 12px; 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 a { display: inline-flex; align-items: center; min-height: 44px; }
summary { min-height: 48px; }

@media (hover: hover) {
  .tile:hover { background: rgba(255, 255, 255, .18); }
  .tile[aria-pressed="true"]:hover { background: var(--paper); }
  .ans:hover, .alt button:hover, .alt a:hover { border-color: var(--accent); }
  .btn:hover { filter: brightness(1.06); }
}

/* 1279px 까지는 좁은 화면 = 한 칸(갤럭시 Z 폴드5 접힘 360·펼침 1100, 카톡 인앱 360~412·1066 포함) */
@media (max-width: 1279px) {
  .layout { display: block; }
}
@media (min-width: 600px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:last-child { grid-column: auto; }
  .names-list { grid-template-columns: 1fr 1fr; }
  .alt ul { grid-template-columns: 1fr 1fr; }
  .card { padding: 22px 24px; }
  .result { padding: 0; }
  .result-head { padding: 20px 24px 16px; }
  .res-body, .result .nav-row { padding-left: 24px; padding-right: 24px; }
  #copy { flex-basis: 180px; flex-grow: 0; }
}
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tile { min-height: 132px; }
}
@media (min-width: 1280px) {
  :root { --wrap: 1180px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "step step" "flow names" "flow notice" "flow ."; gap: 0 24px; align-items: start; }
  .stepper { grid-area: step; }
  .flow { grid-area: flow; }
  .names { grid-area: names; }
  .notice { grid-area: notice; }
  .names-list { grid-template-columns: 1fr; }
  h1 { font-size: 44px; }
}
@media (max-width: 380px) {
  .tile { padding: 10px; }
  .tile-t { font-size: 15px; }
  .stepper li { font-size: 12px; }
  #h-ask { font-size: 19px; }
}

/* 투명도 줄이기: 유리질감 대신 단색 */
@media (prefers-reduced-transparency: reduce) {
  .glass, .tile { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass { background: var(--paper); }
  .tile { background: var(--hero-2); }
}

/* 움직임(motion-design: 상태 변화를 알리는 것만, 200ms 안팎). 줄이기 설정이면 아래 reduce 블록이 전부 끈다. 처음부터 투명한 내용은 없다. */
@media (prefers-reduced-motion: no-preference) {
  .tile, .ans, .btn, .alt button, .alt a, .stepper b, .status, .result-head { transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease); }
  .stepper::after, .qbar span { transition: transform .22s var(--ease); }
  .q-in { animation: card-in .22s var(--ease); }
  .q-in .status { animation: badge-in .2s var(--ease); }
  @keyframes card-in { from { transform: translateY(8px); } to { transform: none; } }
  @keyframes badge-in { from { transform: scale(.92); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
