:root {
  --ink: #1B2A2F;
  --muted: #5F6F76;
  --line: #E3E9EA;
  --bg: #F5F7F7;
  --surface: #FFFFFF;
  --brand: #1F5F5B;
  --brand-strong: #174A47;
  --brand-soft: #E3F0EE;
  --warn: #D9791A;
  --warn-bg: #FDF0E4;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }

/* 카드 이미지 우측 하단 저작권 표시 */
.art { position: relative; display: block; }
.art .badge {
  position: absolute; bottom: 8px; right: 10px; pointer-events: none;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: #fff;
  text-shadow: 0 0 3px rgb(0 0 0 / 0.7), 0 1px 2px rgb(0 0 0 / 0.5);
}
.hero .art .badge { bottom: 12px; right: 14px; font-size: 11px; }

/* 목록 */
.home-head { text-align: center; margin: 12px 0 24px; }
.title-box {
  display: inline-flex; align-items: center; gap: 14px; max-width: 100%;
  padding: 14px 22px 14px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
}
.title-box .logo { flex-shrink: 0; width: 52px; height: 52px; }
.title-box h1 { margin: 0; padding-left: 14px; border-left: 1px solid var(--line); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-align: left; }
.title-box h1 span { display: block; }
.title-box h1 { line-height: 1.25; }
@media (min-width: 640px) {
  .title-box .logo { width: 60px; height: 60px; }
  .title-box h1 { font-size: 24px; line-height: 1.4; }
  .title-box h1 span { display: inline; }
}
.hint { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* 흐름도: 파스텔 팔레트(참고 이미지 기준)
   단계마다 --bg 배경, --pill 글자 동그라미, --accent 강조 테두리, --text 진한 글자 */
.flow { --arrow: #C7BECC; display: grid; grid-template-columns: 1fr; gap: 12px; }
.step-a { --bg: #F0F8E7; --pill: #DFEFC8; --accent: #C2DD9D; --text: #3B5F11; }
.step-b { --bg: #FDF6D8; --pill: #FCEAAC; --accent: #F7DC8C; --text: #7C500E; }
.step-c { --bg: #EAF5FD; --pill: #CAE2F9; --accent: #A4CDF4; --text: #1B5083; }
.step-d { --bg: #FEECE6; --pill: #FED8CE; --accent: #FDB7A5; --text: #893629; }
.flow-col {
  display: flex; flex-direction: column; padding: 14px;
  border-radius: 20px; background: var(--bg);
}
.flow-head { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; color: var(--text); }
.flow-head .step {
  display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--pill); font-size: 13px; font-weight: 800;
}
.flow-head h2 { margin: 1px 0 0; font-size: 18px; font-weight: 800; line-height: 1.5; letter-spacing: -0.01em; text-wrap: balance; }
.flow-col ul { display: flex; flex-direction: column; gap: 8px; }
.flow-col a {
  display: flex; gap: 10px; padding: 11px 13px; border: 1px solid transparent; border-radius: 12px; background: #fff;
  font-size: 16px; line-height: 1.5; color: var(--ink); transition: border-color 0.15s, color 0.15s;
}
.flow-col a b { flex-shrink: 0; min-width: 1.4em; padding-top: 1px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.flow-col a:hover { border-color: var(--accent); color: var(--text); }
.flow-col a:active { transform: scale(0.98); }
.flow-col a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.nowrap { white-space: nowrap; }
.flow-gap, .bus { display: none; }

/* 가로 도식: 흐름도를 감싼 상자가 736px 이상일 때 (화면 768px 이상, 또는 축소 도식) */
@container flow (min-width: 736px) {
  .flow { grid-template-columns: 1fr 32px 1fr 32px 1fr 32px 1fr; gap: 0; }
  .flow-head h2 { min-height: calc(2 * 1.5em); }
  /* 상자 폭 1148px 이상이면 단계 제목이 모두 한 줄에 들어간다 */
  @container flow (min-width: 1148px) { .flow-head h2 { min-height: 0; } }
  /* 태블릿 폭에서는 칸이 좁으니 글씨와 여백을 줄인다 */
  @container flow (max-width: 1000px) {
    .flow-col { padding: 12px; }
    .flow-head h2 { font-size: 16px; }
    .flow-col a { gap: 8px; padding: 9px 10px; font-size: 14px; }
    .flow-col a b { font-size: 12px; }
  }
  .flow-gap { display: block; }

  /* 버스 화살표: 그리드 7칸을 그대로 이어받아 각 단계 가운데에 맞춘다 */
  .bus { position: relative; display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; height: 24px; }
  .bus-top { margin-bottom: 12px; }
  .bus-bottom { margin-top: 12px; }
  .bus span { position: relative; grid-row: 1; border: 0 solid var(--arrow); }
  .bus-top .leg, .bus-top .run { border-top-width: 4px; }
  .bus-bottom .leg, .bus-bottom .run { border-bottom-width: 4px; }
  .bus .run { grid-column: 2 / 7; }
  .bus .leg { width: calc(50% + 2px); }
  .bus .first { grid-column: 1; justify-self: end; border-left-width: 4px; }
  .bus .last { grid-column: 7; justify-self: start; border-right-width: 4px; }
  .bus .drop { justify-self: center; width: 4px; background: var(--arrow); }
  /* 화살촉: 위 버스는 아래로(B·C·D), 아래 버스는 위로(A·B·C) */
  .bus .drop::after, .bus-top .last::after, .bus-bottom .first::after {
    content: ""; position: absolute; border: 9px solid transparent;
  }
  .bus-top .drop::after, .bus-top .last::after { top: 100%; border-bottom: 0; border-top: 11px solid var(--arrow); }
  .bus-bottom .drop::after, .bus-bottom .first::after { bottom: 100%; border-top: 0; border-bottom: 11px solid var(--arrow); }
  .bus .drop::after { left: -7px; }
  .bus-top .last::after { right: -11px; }
  .bus-bottom .first::after { left: -11px; }
  .bus-top .drop::after { margin-top: -1px; }
}

/* 작은 화면: 가로 도식을 통째로 줄여 보여 주고, 그 아래에 영역별 글상자를 쌓는다 */
.flow-host { container: flow / inline-size; }
.flow-mini { position: relative; overflow: hidden; margin-bottom: 20px; }
.flow-mini-inner { width: 880px; transform-origin: top left; }
/* 축소 도식에서는 습관을 흰 동그라미 속 번호로만 보여 준다 */
.flow-mini .flow-head h2 { font-size: 21px; }
.flow-mini .flow-col ul { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 4px 0 2px; }
.flow-mini .flow-col a { width: 78px; height: 78px; padding: 0; border: 3px solid transparent; border-radius: 50%; align-items: center; justify-content: center; }
.flow-mini .flow-col a:active { border-color: var(--text); transform: none; }
.flow-mini .flow-col a span { display: none; }
.flow-mini .flow-col a b { min-width: 0; padding: 0; font-size: 28px; font-weight: 800; }
@media (min-width: 768px) {
  .flow-mini { display: none; }
  /* 제목 박스를 흐름도 전체 폭으로 */
  .title-box { display: flex; justify-content: center; width: 100%; padding: 18px 24px; }
}

/* 상세 */
.detail, .back, .pager { max-width: 560px; margin-left: auto; margin-right: auto; }
.back { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.detail {
  display: flex; flex-direction: column; gap: 16px;
  /* 영역 색에서 파생한 톤: 진한 글자, 옅은 배경, 옅은 테두리 */
  --domain-strong: color-mix(in srgb, var(--domain) 78%, #000);
  --domain-soft: color-mix(in srgb, var(--domain) 10%, #fff);
  --domain-line: color-mix(in srgb, var(--domain) 30%, #fff);
}

.hero {
  overflow: hidden; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #122A2F, #162831 50%, #0D1C24);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.18);
}
.hero img { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; }
.hero-body { padding: 20px; }
.hero-num { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: #34d399; }
.hero-num .domain { letter-spacing: 0; }
.hero h1 { margin: 8px 0 0; font-size: 22px; line-height: 1.35; letter-spacing: -0.02em; }
.hero-en { margin: 4px 0 0; font-size: 14px; color: rgb(255 255 255 / 0.7); }
.hero blockquote {
  margin: 14px 0 0; padding: 12px; border: 1px solid rgb(255 255 255 / 0.1); border-radius: 12px;
  background: rgb(255 255 255 / 0.05); font-size: 13px; font-weight: 500; color: rgb(209 250 229 / 0.9);
  text-align: center; text-wrap: balance;
}

.box { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.box h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.box p { margin: 0; font-size: 15px; line-height: 1.7; }
/* 코치 질문: 영역 색 글자 + 양옆 파스텔 구분선 */
.question { display: flex; align-items: center; gap: 1.5em; padding: 6px 0; font-size: 17px; color: var(--domain); }
.question::before, .question::after {
  content: ""; flex: 1; min-width: 20px; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--domain) 28%, #fff);
}
.question p { flex-shrink: 0; max-width: 80%; margin: 0; text-align: center; font-size: 17px; font-weight: 700; line-height: 1.5; }
.question p { text-wrap: balance; }
.question .ql { white-space: nowrap; }
@media (max-width: 379px) { .question p { font-size: 15.5px; } }
@media (min-width: 480px) { .question p { font-size: 18px; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--domain-line); border-radius: 999px; background: var(--domain-soft);
  font-size: 13px; font-weight: 600; color: var(--domain-strong);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--domain); }
.chip small { font-size: 12px; font-weight: 400; color: var(--muted); }

.box .example { padding: 14px; border-left: 4px solid var(--domain); border-radius: 0 12px 12px 0; background: var(--bg); }

.cautions { display: flex; flex-direction: column; gap: 8px; }
.cautions li {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px;
  border: 1px solid var(--domain-line); border-radius: 12px; background: var(--domain-soft);
  font-size: 15px; line-height: 1.6;
}
.cautions i { flex-shrink: 0; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--domain); }

.indicators { display: flex; flex-direction: column; gap: 8px; counter-reset: ind; }
.indicators li {
  position: relative; padding: 12px 12px 12px 44px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; line-height: 1.6; counter-increment: ind;
}
.indicators li::before {
  content: counter(ind); position: absolute; left: 12px; top: 12px;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--domain-soft); color: var(--domain-strong); font-size: 12px; font-weight: 700;
}

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.pager a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; font-weight: 600; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }

.source { margin: 40px 0 0; padding: 16px 8px 0; border-top: 1px solid var(--line); text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); }
.copyright { margin-top: 12px; text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); }
.copyright p { margin: 0; font-weight: 700; color: var(--ink); }
