/* 한빛아파트 공개 자료 시연(/redevelopment/demo/hanbit/). 소개 화면(landing.css)과 같은 집안이다: 웜 페이퍼 바탕, 1px 헤어라인, Pretendard 가는 제목,
   코발트는 링크·고른 상태, 그림의 막대·선은 신뢰 네이비 한 색, 점선은 '한빛아파트 기록 없음'. 네이비 면은 쓰지 않는다.
   조합원이 읽는 화면이라 본문은 글자 크기 단계(--rd-fs-body, 18·21·24px)를 따르고, 누르는 자리는 56px이다(DESIGN.md).
   색은 모두 lm-tokens.css 변수다(이 파일에 hex를 두지 않는다). CSP 때문에 인라인 스타일이 없다. 접두어는 hb-. */

.hb {
  font-size: var(--rd-fs-body);
  line-height: var(--rd-lh-body);
}

.hb h3,
.hb h4 {
  margin: 0;
  color: var(--lm-text-strong);
  text-wrap: balance;
}

/* ── 위 막대: 글자 크기와 서비스 소개 ── */

.hb-bar__end {
  display: flex;
  align-items: center;
  gap: var(--lm-space-16);
  margin-left: auto;
}

.hb-font {
  display: flex;
  align-items: center;
  gap: var(--lm-space-8);
}

.hb-font__label {
  color: var(--lm-text-strong);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.hb-font__set {
  display: inline-flex;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  overflow: hidden;
}

.hb-font__btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 56px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--lm-hairline);
  background: transparent;
  color: var(--lm-text-strong);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-font__btn:first-child {
  border-left: 0;
}

.hb-font__btn.is-m {
  font-size: 16px;
}

.hb-font__btn.is-l {
  font-size: 20px;
}

.hb-font__btn.is-xl {
  font-size: 24px;
}

.hb-font__btn[aria-pressed="true"] {
  background: var(--lm-bg-selected);
  box-shadow: inset 0 -3px 0 var(--lm-primary);
}

@media (hover: hover) {
  .hb-font__btn:hover {
    background: var(--lm-bg-subtle);
  }
}

/* ── 맨 위 고지(시연·관계없음·기준일) ── */

.hb-notice {
  border-bottom: 1px solid var(--lm-warning-accent);
  background: var(--lm-warning-surface);
  color: var(--lm-warning-text);
}

.hb-notice__inner {
  display: flex;
  align-items: flex-start;
  gap: var(--lm-space-12);
  padding-top: var(--lm-space-12);
  padding-bottom: var(--lm-space-12);
  font-size: var(--rd-fs-small);
  font-weight: 600;
  line-height: 1.6;
}

.hb-notice__inner .icon {
  margin-top: 3px;
}

.hb-notice__date {
  font-weight: 500;
  white-space: nowrap;
}

/* ── 첫머리 ── */

.hb-hero {
  padding: 56px 0 24px;
}

.hb-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
}

.hb-hero h1 {
  margin: 0 0 24px;
  color: var(--lm-text-strong);
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hb-lead {
  max-width: 36em;
  margin: 0 0 16px;
  font-size: max(var(--rd-fs-body), 19px);
  line-height: 1.7;
}

.hb-facts {
  margin: 0;
  border-top: 1px solid var(--lm-border-strong);
}

.hb-facts > div {
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-facts dt {
  color: var(--lm-text-muted);
  font-size: 14px;
  font-weight: 600;
}

.hb-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--lm-space-12);
  margin: 2px 0 0;
}

.hb-fact {
  color: var(--lm-text-strong);
  font-size: 26px;
  font-weight: 350;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hb-facts dd > span {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
}

.hb-facts .hb-cite {
  flex-basis: 100%;
}

/* 차례 */
.hb-toc {
  margin-top: 40px;
}

.hb-toc ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--lm-border-strong);
  list-style: none;
}

.hb-toc li {
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-toc a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 var(--lm-space-12) 0 0;
  color: var(--lm-primary);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-toc a:hover {
  color: var(--lm-primary-pressed);
  text-decoration: underline;
}

.hb-load,
.hb-noscript {
  padding-top: var(--lm-space-24);
  padding-bottom: var(--lm-space-24);
  color: var(--lm-text-muted);
}

.hb-load.is-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lm-space-12);
  color: var(--lm-danger);
  font-weight: 600;
}

/* ── 절 ── */

.hb-section {
  padding: 80px 0;
  border-top: 1px solid var(--lm-hairline);
  scroll-margin-top: 64px;
}

.hb-section--surface {
  background: var(--lm-bg-surface);
}

.hb-head {
  max-width: 46em;
  margin-bottom: 40px;
}

.hb-head h2 {
  margin: 0 0 14px;
  color: var(--lm-text-strong);
  font-size: clamp(28px, 2.8vw, 38px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hb-head p {
  margin: 0;
  font-size: var(--rd-fs-body);
  line-height: 1.75;
}

.hb-subhead {
  margin: 0 0 4px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
}

.hb-hint {
  margin: 0 0 var(--lm-space-16);
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
}

/* ── 문장과 출처 ── */

.hb-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-s {
  padding: 12px 0 6px;
}

.hb-list > .hb-s + .hb-s {
  border-top: 1px solid var(--lm-hairline);
}

.hb-s__text {
  margin: 0;
  color: var(--lm-text);
  font-size: var(--rd-fs-body);
  line-height: 1.7;
}

.hb-list--small .hb-s__text {
  font-size: var(--rd-fs-small);
  line-height: 1.65;
}

/* 출처 단추: 첫 출처의 이름·날짜. 글자처럼 보이되 누르는 자리는 44px 이상 */
.hb-cite {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--lm-text-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.hb-cite .icon {
  color: var(--lm-primary);
}

.hb-cite__who {
  color: var(--lm-text);
  text-decoration: underline;
  text-decoration-color: var(--lm-border);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--lm-duration-fast) var(--lm-ease-out), color var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-cite__date,
.hb-cite__more {
  font-variant-numeric: tabular-nums;
}

.hb-cite__more {
  padding: 0 8px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-pill);
}

@media (hover: hover) {
  .hb-cite:hover .hb-cite__who {
    color: var(--lm-primary-pressed);
    text-decoration-color: var(--lm-primary);
  }
}

/* ── 지금 단계: 법정 단계 시간줄 ── */

.hb-timeline {
  margin-bottom: 56px;
}

.hb-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--lm-border-strong);
  list-style: none;
}

.hb-steps__now {
  padding: var(--lm-space-16) 0;
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-now {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 16px;
  border: 1px dashed var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
}

.hb-now__who {
  color: var(--lm-text-muted);
  font-size: 14px;
  font-weight: 600;
}

.hb-now strong {
  font-size: var(--rd-fs-body);
  line-height: 1.3;
}

.hb-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--lm-hairline);
  background: transparent;
  color: var(--lm-text);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-step__no {
  display: inline-grid;
  grid-row: span 2;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius-pill);
  background: var(--lm-bg-surface);
  color: var(--lm-text-strong);
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.hb-step__name {
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 700;
  line-height: 1.35;
}

.hb-step__plain {
  grid-column: 2;
  color: var(--lm-text-muted);
  font-size: 15px;
  line-height: 1.45;
}

.hb-step .icon {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--lm-text-muted);
  transition: transform var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-step[aria-expanded="true"] {
  background: var(--lm-bg-selected);
}

.hb-step[aria-expanded="true"] .hb-step__no {
  border-color: var(--lm-primary);
  background: var(--lm-primary);
  color: var(--lm-on-primary);
}

.hb-step[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

@media (hover: hover) {
  .hb-step:hover {
    background: var(--lm-bg-subtle);
  }

  .hb-step[aria-expanded="true"]:hover {
    background: var(--lm-bg-selected);
  }
}

.hb-step__notes {
  padding: var(--lm-space-8) 0 var(--lm-space-16) 48px;
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-step__title {
  display: none;
  margin: 0 0 4px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
}

.hb-position {
  margin-top: var(--lm-space-8);
}

/* 넓은 화면: 단계를 가로 한 줄로, 고른 단계의 설명은 그 아래 한 칸으로 */
@media (min-width: 1000px) {
  .hb-steps {
    grid-template-columns: auto repeat(9, minmax(0, 1fr));
    border-top: 0;
  }

  .hb-steps__item {
    display: contents;
  }

  .hb-steps__now {
    grid-row: 1;
    grid-column: 1;
    align-self: start;
    padding: 0 20px 0 0;
    border-bottom: 0;
  }

  .hb-step {
    position: relative;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-items: start;
    gap: 6px;
    min-height: 0;
    padding: 0 6px 18px;
    border-bottom: 3px solid transparent;
  }

  /* 단계를 잇는 가로선: 번호 원의 가운데 높이 */
  .hb-step::before {
    content: "";
    position: absolute;
    top: 16px;
    right: 0;
    left: 0;
    border-top: 1px solid var(--lm-border-strong);
  }

  .hb-step__no {
    position: relative;
    grid-row: auto;
  }

  .hb-step__plain {
    grid-column: 1;
    font-size: 14px;
  }

  .hb-step__name {
    font-size: 16px;
  }

  .hb-step .icon {
    display: none;
  }

  .hb-step[aria-expanded="true"] {
    border-bottom-color: var(--lm-primary);
    background: transparent;
  }

  .hb-step__notes {
    grid-row: 2;
    grid-column: 1 / -1;
    padding: var(--lm-space-20) 0 var(--lm-space-16);
    border-top: 1px solid var(--lm-border-strong);
  }

  .hb-step__title {
    display: block;
  }

  .hb-step__notes .hb-list {
    max-width: 52em;
  }
}

/* 세 묶음(공식 기록·추진 단체와 후보의 말·대전 제도와 사례) */
.hb-cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.hb-cols3 h3,
.hb-basics h3,
.hb-lifeline h3,
.hb-people h3 {
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--lm-border-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
}

/* ── 그림 ── */

.hb-figs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

.hb-figure {
  min-width: 0;
  margin: 0 0 32px;
  padding: 24px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
}

.hb-figure__title {
  margin-bottom: 16px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
  line-height: 1.4;
}

.hb-plot {
  width: 100%;
  min-height: 40px;
}

.hb-chart {
  display: block;
  max-width: none;
  overflow: visible;
  font-family: var(--lm-font-ui);
}

.hb-chart text {
  fill: var(--lm-text);
  font-size: 15px;
}

.hb-chart .is-strong,
.hb-chart tspan.is-strong {
  fill: var(--lm-text-strong);
  font-weight: 650;
}

.hb-chart .hb-value {
  fill: var(--lm-text-strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hb-chart .hb-tick {
  fill: var(--lm-text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hb-mark {
  fill: var(--lm-trust);
}

.hb-baseline {
  stroke: var(--lm-border-strong);
  stroke-width: 1;
}

.hb-grid {
  stroke: var(--lm-hairline);
  stroke-width: 1;
}

.hb-range {
  stroke: var(--lm-trust);
  stroke-width: 2;
  stroke-linecap: round;
}

.hb-dot {
  fill: var(--lm-trust);
  stroke: var(--lm-bg-surface);
  stroke-width: 2;
}

.hb-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 12px;
  color: var(--lm-text-muted);
  font-size: 15px;
}

.hb-key {
  display: inline-block;
  flex: none;
}

.hb-key.is-range,
.hb-key.is-line {
  width: 28px;
  border-top: 2px solid var(--lm-trust);
}

.hb-key.is-dash {
  width: 28px;
  border-top: 2px dashed var(--lm-text-muted);
}

.hb-key.is-dot {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border-radius: var(--lm-radius-pill);
  background: var(--lm-trust);
}

.hb-key.is-arrow {
  width: 12px;
  height: 12px;
  fill: var(--lm-trust);
}

.hb-meta {
  display: grid;
  gap: 2px;
  margin: 16px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--lm-hairline);
}

.hb-meta > div {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.hb-meta dt {
  color: var(--lm-text-muted);
  font-size: 14px;
  font-weight: 600;
}

.hb-meta dd {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
}

.hb-meta dd .hb-cite {
  min-height: 32px;
  padding: 0;
  vertical-align: middle;
}

.hb-multiples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.hb-multiple {
  min-width: 0;
}

.hb-multiple__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 8px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 700;
}

.hb-multiple__sum {
  color: var(--lm-text-muted);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 표로 보기 */
.hb-table {
  margin-top: 12px;
  border-top: 1px solid var(--lm-hairline);
}

.hb-table summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--lm-primary);
  font-size: var(--rd-fs-small);
  font-weight: 600;
  cursor: pointer;
}

.hb-table summary:hover {
  color: var(--lm-primary-pressed);
}

.hb-table__scroll {
  overflow-x: auto;
}

.hb-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.hb-table th,
.hb-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--lm-hairline);
  text-align: left;
  vertical-align: top;
}

.hb-table thead th {
  color: var(--lm-text-muted);
  font-size: 14px;
  font-weight: 600;
  border-bottom-color: var(--lm-border-strong);
}

.hb-table tbody th {
  color: var(--lm-text-strong);
  font-weight: 600;
}

.hb-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hb-table .hb-cite {
  min-height: 32px;
  padding: 0;
  font-size: 14px;
}

/* 단지 기본 사실과 주차 */
.hb-basics {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  margin-top: 16px;
}

.hb-dl {
  margin: 0;
}

.hb-dl > div {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-dl dt {
  padding-top: 2px;
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 600;
}

.hb-dl dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  margin: 0;
  color: var(--lm-text-strong);
}

.hb-dl dd .hb-cite {
  min-height: 36px;
}

/* ── 관계 그림 ── */

.hb-graph {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.hb-graph__main {
  min-width: 0;
}

.hb-graph__hint {
  margin: 0 0 8px;
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
}

.hb-graph__plot {
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
}

.hb-graph-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  font-family: var(--lm-font-ui);
}

.hb-edge {
  fill: none;
  stroke: var(--lm-border);
  stroke-width: 1.5;
  transition: stroke var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-edge.is-legal {
  stroke-dasharray: 7 6;
}

.hb-edge.is-on {
  stroke: var(--lm-trust);
  stroke-width: 2.5;
}

.hb-arrowhead.is-off {
  fill: var(--lm-border);
}

.hb-arrowhead.is-on {
  fill: var(--lm-trust);
}

.hb-edge-label rect {
  fill: var(--lm-bg-surface);
  stroke: var(--lm-hairline);
  stroke-width: 1;
}

.hb-edge-label text {
  fill: var(--lm-text-muted);
  font-size: 15px;
  font-weight: 500;
}

.hb-graph-svg.is-narrow .hb-edge-label text {
  font-size: 14px;
}

.hb-edge-label .is-sub {
  font-size: 13px;
}

.hb-edge-label.is-on rect {
  stroke: var(--lm-trust);
}

.hb-edge-label.is-on text {
  fill: var(--lm-text-strong);
  font-weight: 600;
}

.hb-node {
  cursor: pointer;
  outline: none;
}

.hb-node rect {
  fill: var(--lm-bg-surface);
  stroke: var(--lm-border-strong);
  stroke-width: 1;
  transition: fill var(--lm-duration-fast) var(--lm-ease-out), stroke var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-node.is-center rect {
  fill: var(--lm-trust-soft);
  stroke: var(--lm-trust);
  stroke-width: 1.5;
}

.hb-node.is-linked rect {
  stroke: var(--lm-trust);
  stroke-width: 1.5;
}

.hb-node.is-selected rect {
  fill: var(--lm-bg-selected);
  stroke: var(--lm-primary);
  stroke-width: 3;
}

.hb-node.is-dim rect {
  stroke: var(--lm-hairline);
}

.hb-node:focus-visible rect {
  stroke: var(--lm-focus);
  stroke-width: 4;
}

.hb-node__name {
  fill: var(--lm-text-strong);
  font-size: 18px;
  font-weight: 700;
}

.hb-node__sub {
  fill: var(--lm-text-muted);
  font-size: 14px;
}

.hb-graph-svg.is-narrow .hb-node__name {
  font-size: 16px;
}

.hb-graph-svg.is-narrow .hb-node__sub {
  font-size: 13px;
}

@media (hover: hover) {
  .hb-node:hover rect {
    stroke: var(--lm-primary);
  }
}

/* 좁은 칸의 가지: 이어진 노드 상자 안에 관계 이름 */
.hb-graph-svg.is-narrow .hb-node.is-legal rect {
  stroke-dasharray: 7 6;
}

.hb-node__rel {
  fill: var(--lm-text);
  font-size: 14px;
}

.hb-graph__others .hb-graph__sub {
  margin-top: 16px;
}

.hb-graph__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hb-chipbtn {
  min-height: 48px;
  padding: 6px 14px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

@media (hover: hover) {
  .hb-chipbtn:hover {
    border-color: var(--lm-primary);
    background: var(--lm-bg-selected);
  }
}

.hb-graph__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--lm-text-muted);
  font-size: 15px;
  list-style: none;
}

.hb-graph__legend li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hb-graph__panel {
  padding-top: 12px;
  border-top: 1px solid var(--lm-border-strong);
}

.hb-graph__name {
  display: grid;
  gap: 2px;
  margin: 0 0 4px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
  line-height: 1.35;
}

.hb-graph__name span {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 500;
}

.hb-graph__sub {
  margin: 20px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--lm-border-strong);
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 700;
}

.hb-rel {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-rel li {
  padding: 10px 0 2px;
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-rel__who {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 650;
}

.hb-rel__what {
  margin: 2px 0 0;
  font-size: var(--rd-fs-small);
  line-height: 1.6;
}

.hb-rel__tag {
  display: inline-block;
  margin: 6px 0 0;
  padding: 0 10px;
  border: 1px dashed var(--lm-border-strong);
  border-radius: var(--lm-radius-pill);
  color: var(--lm-text);
  font-size: 14px;
  font-weight: 600;
}

/* ── 얻는 것과 내는 것: 두 칸 같은 무게 ── */

/* 같은 차례의 두 주제를 한 줄에 짝짓는다(주거 ↔ 이주, 가격 사례 ↔ 분담금과 사업비 …). 줄마다 두 칸의 높이가 같다 */
.hb-scale__head,
.hb-scale__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
}

.hb-scale__row > * {
  min-width: 0;
}

.hb-scale__name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lm-text-strong);
  color: var(--lm-text-strong);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hb-scale__name span {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 500;
  letter-spacing: 0;
}

.hb-group {
  padding: 24px 0 8px;
  border-bottom: 1px solid var(--lm-border-strong);
}

.hb-group__side {
  margin: 0 0 2px;
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 600;
}

.hb-group h3 {
  margin: 0 0 4px;
  font-size: var(--rd-fs-h2);
  font-weight: 700;
  line-height: 1.4;
}

.hb-when {
  margin: 12px 0 8px;
  padding: 10px 0 0;
  border-top: 1px dashed var(--lm-border);
}

.hb-when__head,
.hb-nocalc__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 700;
}

.hb-when__head .icon,
.hb-nocalc__head .icon {
  color: var(--lm-primary);
}

.hb-nocalc {
  max-width: 52em;
  margin-top: 40px;
  padding: 20px 24px 8px;
  border: 1px dashed var(--lm-border);
  border-radius: var(--lm-radius);
}

.hb-nocalc__lead {
  margin: 6px 0 0;
}

/* ── 기대효과와 우려: 주제마다 두 칸 ── */

.hb-pairs {
  border-top: 1px solid var(--lm-border-strong);
}

.hb-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 48px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--lm-border-strong);
}

.hb-pair__topic {
  grid-column: 1 / -1;
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hb-pair__side {
  min-width: 0;
}

.hb-pair__label {
  margin: 8px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--lm-hairline);
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 700;
}

/* ── 내 사정에 비춰 보기 ── */

.hb-lens {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}

.hb-lens__qs {
  display: grid;
  gap: 24px;
}

.hb-q {
  min-width: 0;
}

.hb-q__label {
  margin: 0 0 10px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 700;
}

.hb-q__opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.hb-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out), border-color var(--lm-duration-fast) var(--lm-ease-out);
}

.hb-opt__box {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--lm-border-strong);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
  color: var(--lm-on-primary);
}

.hb-opt__box .icon {
  visibility: hidden;
}

.hb-opt[aria-pressed="true"] {
  border-color: var(--lm-primary);
  background: var(--lm-bg-selected);
  box-shadow: inset 0 0 0 1px var(--lm-primary);
}

.hb-opt[aria-pressed="true"] .hb-opt__box {
  border-color: var(--lm-primary);
  background: var(--lm-primary);
}

.hb-opt[aria-pressed="true"] .hb-opt__box .icon {
  visibility: visible;
}

@media (hover: hover) {
  .hb-opt:hover {
    border-color: var(--lm-text);
    background: var(--lm-bg-subtle);
  }

  .hb-opt[aria-pressed="true"]:hover {
    border-color: var(--lm-primary);
    background: var(--lm-bg-selected);
  }
}

.hb-q__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
}

.hb-q__note .icon {
  margin-top: 3px;
}

.hb-reset {
  justify-self: start;
}

.hb-lens__result {
  min-width: 0;
}

.hb-lens__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lm-text-strong);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hb-lens__head span {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 500;
  letter-spacing: 0;
}

.hb-empty {
  margin: 16px 0;
  padding: 16px 20px;
  border: 1px dashed var(--lm-border);
  border-radius: var(--lm-radius);
  color: var(--lm-text);
}

.hb-lensitems {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-lensitem {
  padding: 20px 0 8px;
  border-bottom: 1px solid var(--lm-border-strong);
}

.hb-lensitem__title {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
}

.hb-lensitem__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 4px;
  color: var(--lm-text-strong);
}

.hb-lensitem__check .icon {
  margin-top: 4px;
  color: var(--lm-primary);
}

.hb-lensitem__label {
  font-weight: 700;
}

.hb-more {
  margin-top: 24px;
}

.hb-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 4px;
  border-top: 1px solid var(--lm-border-strong);
  border-bottom: 1px solid var(--lm-hairline);
  color: var(--lm-primary);
  font-weight: 600;
  cursor: pointer;
}

.hb-more > summary span {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 500;
}

.hb-more .hb-lensitem__title {
  font-size: var(--rd-fs-body);
}

/* 내 삶의 시간표 */
.hb-lifeline {
  margin-top: 64px;
}

.hb-lifeline__lead {
  max-width: 46em;
  margin: 0 0 20px;
}

.hb-lifeline > .hb-q {
  max-width: 520px;
  margin-bottom: 20px;
}

.hb-lifelist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-life {
  position: relative;
  padding: 14px 0 10px 52px;
  border-bottom: 1px solid var(--lm-hairline);
}

/* 단계를 잇는 세로선 */
.hb-life::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 17px;
  border-left: 1px solid var(--lm-border-strong);
}

.hb-life:first-child::before {
  top: 30px;
}

.hb-life:last-child::before {
  bottom: auto;
  height: 30px;
}

.hb-life__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 700;
}

.hb-life__no {
  position: absolute;
  top: 14px;
  left: 2px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius-pill);
  background: var(--lm-bg-surface);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.hb-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--lm-radius-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.hb-chip.is-before {
  border: 1px dashed var(--lm-border-strong);
  color: var(--lm-text);
}

.hb-life > .hb-s {
  padding-top: 4px;
}

.hb-fork {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 32px;
  margin: 8px 0 4px;
}

.hb-fork > div {
  padding-top: 8px;
  border-top: 1px dashed var(--lm-border);
}

.hb-fork__label {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 700;
}

.hb-cases-wrap {
  margin-top: 40px;
}

.hb-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--lm-hairline);
}

.hb-case__name {
  display: grid;
  margin: 0 0 4px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  font-weight: 700;
}

.hb-case__name span {
  color: var(--lm-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.hb-case__marks {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 15px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

/* 함께 정하는 사람 */
.hb-people {
  max-width: 720px;
  margin-top: 64px;
}

.hb-people > p {
  margin: 0 0 12px;
}

.hb-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.hb-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  color: var(--lm-text-strong);
  font-weight: 600;
  cursor: pointer;
}

.hb-check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
}

.hb-check:has(input:checked) {
  border-color: var(--lm-primary);
  background: var(--lm-bg-selected);
}

.hb-house {
  margin: 0;
}

/* ── 아직 모르는 것 ── */

.hb-unknowns {
  max-width: 56em;
  margin: 0;
  padding: 4px 24px;
  border: 1px dashed var(--lm-border);
  border-radius: var(--lm-radius);
  list-style: none;
}

.hb-unknown {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0 4px;
}

.hb-unknown + .hb-unknown {
  border-top: 1px solid var(--lm-hairline);
}

.hb-unknown > .icon {
  margin-top: 5px;
  color: var(--lm-text-strong);
}

/* ── 출처 ── */

.hb-srcgroup {
  border-bottom: 1px solid var(--lm-border-strong);
}

.hb-srcgroup:first-child {
  border-top: 1px solid var(--lm-border-strong);
}

.hb-srcgroup > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
  cursor: pointer;
}

.hb-srcgroup > summary::after {
  content: "펼치기";
  color: var(--lm-primary);
  font-size: var(--rd-fs-small);
  font-weight: 600;
}

.hb-srcgroup[open] > summary::after {
  content: "접기";
}

.hb-srcgroup__name {
  flex: 1 1 auto;
}

.hb-srcgroup__count {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.hb-srcgroup .hb-srclist {
  padding-bottom: 24px;
}

/* 주제의 나머지 문장 */
.hb-fold > summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--lm-primary);
  font-size: var(--rd-fs-small);
  font-weight: 600;
  cursor: pointer;
}

.hb-fold > summary:hover {
  color: var(--lm-primary-pressed);
}

.hb-fold[open] > summary {
  border-bottom: 1px solid var(--lm-hairline);
}

.hb-srclist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-srclist li {
  padding: 12px 0;
  border-bottom: 1px solid var(--lm-hairline);
  font-size: 15px;
  line-height: 1.55;
}

.hb-srclist p {
  margin: 0;
}

.hb-srclist__pub {
  color: var(--lm-text-strong);
  font-weight: 600;
}

.hb-srclist__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 2px !important;
  color: var(--lm-text-muted);
  font-variant-numeric: tabular-nums;
}

.hb-srclist__link {
  color: var(--lm-primary);
  overflow-wrap: anywhere;
}

/* ── 출처 창 ── */

.hb-sheet__title {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-h2);
  font-weight: 700;
}

.hb-src + .hb-src {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--lm-border-strong);
}

.hb-src p {
  margin: 0;
}

.hb-src__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 6px !important;
  font-size: 15px;
}

.hb-src__date {
  color: var(--lm-text-muted);
  font-variant-numeric: tabular-nums;
}

.hb-conf {
  display: inline-flex;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--lm-radius-pill);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
}

.hb-conf.is-official {
  background: var(--lm-trust-soft);
  color: var(--lm-trust);
}

.hb-conf.is-reported {
  border-color: var(--lm-border);
  color: var(--lm-text);
}

.hb-conf.is-unverified {
  background: var(--lm-warning-surface);
  color: var(--lm-warning-text);
}

.hb-conf.is-none {
  border-style: dashed;
  border-color: var(--lm-border-strong);
  color: var(--lm-text);
}

.hb-src__pub {
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-body);
  font-weight: 700;
  line-height: 1.45;
}

.hb-src__title {
  color: var(--lm-text-muted);
  font-size: var(--rd-fs-small);
}

.hb-src__whose {
  margin-top: 6px !important;
  font-size: var(--rd-fs-small);
}

.hb-src__whose span {
  color: var(--lm-text-muted);
  font-weight: 600;
}

.hb-src__quote {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-page);
  color: var(--lm-text-strong);
  font-size: var(--rd-fs-small);
  line-height: 1.75;
}

.hb-src__mark {
  padding: 1px 0;
  border-bottom: 2px solid var(--lm-primary);
  background: var(--lm-trust-soft);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hb-src__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  color: var(--lm-primary);
  font-weight: 600;
}

/* ── 좁은 화면 ── */

@media (max-width: 1100px) {
  .hb-graph {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .hb-hero__grid,
  .hb-lens,
  .hb-basics,
  .hb-figs {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hb-cols3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hb-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .hb-figs .hb-figure {
    margin-bottom: 0;
  }

  .hb-figs {
    margin-bottom: 32px;
  }
}

@media (max-width: 760px) {
  .hb-scale__row,
  .hb-pair,
  .hb-multiples,
  .hb-fork,
  .hb-cases,
  .hb-srclist {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 좁은 화면: 두 칸 머리 대신 주제마다 '얻는 것'·'내는 것' 표지를 보이고, 짝 사이를 굵은 선으로 나눈다 */
  .hb-scale__head {
    display: none;
  }

  .hb-scale__row {
    border-top: 2px solid var(--lm-text-strong);
  }

  .hb-pair {
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .hb-font__label,
  .hb-bar__home {
    display: none;
  }

  .hb-font__btn {
    width: 44px;
  }

  .hb-hero {
    padding-top: 32px;
  }

  .hb-hero h1 {
    font-size: 28px;
    font-weight: 350;
  }

  .hb-lead {
    font-size: var(--rd-fs-body);
  }

  .hb-section {
    padding: 56px 0;
  }

  .hb-head {
    margin-bottom: 28px;
  }

  .hb-head h2 {
    font-size: 27px;
    font-weight: 350;
  }

  .hb-figure {
    padding: 16px;
  }

  .hb-dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hb-nocalc {
    padding: 16px 16px 4px;
  }

  .hb-unknowns {
    padding: 4px 16px;
  }

  .hb-life {
    padding-left: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb *,
  .hb *::before,
  .hb *::after {
    animation: none !important;
    transition: none !important;
  }
}
