/* 리포트 화면: 목차, 섹션, 벤토 카드, 프로필, 원국 표 */

.el-0 { --el: var(--wood); --el-soft: var(--wood-soft); --el-ink: var(--wood-ink); }
.el-1 { --el: var(--fire); --el-soft: var(--fire-soft); --el-ink: var(--fire-ink); }
.el-2 { --el: var(--earth); --el-soft: var(--earth-soft); --el-ink: var(--earth-ink); }
.el-3 { --el: var(--metal); --el-soft: var(--metal-soft); --el-ink: var(--metal-ink); }
.el-4 { --el: var(--water); --el-soft: var(--water-soft); --el-ink: var(--water-ink); }
.el-avg { --el: var(--hair); --el-soft: var(--bg); --el-ink: var(--muted); }

.report-nav {
  position: sticky; top: var(--header-height); z-index: 15;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--border-width) solid var(--hair);
}
.report-nav ul { display: flex; gap: var(--space-1); max-width: var(--page-width); margin: 0 auto; padding: var(--space-2) var(--space-4); list-style: none; overflow-x: auto; scrollbar-width: none; }
.report-nav a {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 4.5rem; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-lg); color: var(--text); text-decoration: none; font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap;
}
.report-nav .ch-icon { width: var(--nav-icon-size); height: var(--nav-icon-size); }
.report-nav a:hover { background: var(--surface); }
.report-nav a.is-active { background: var(--surface); box-shadow: var(--shadow); }
.card[id] { scroll-margin-top: calc(var(--header-height) + var(--report-nav-height) + var(--space-4)); }
@media (min-width: 560px) { .report-nav ul { justify-content: center; } }

.report-page { display: grid; gap: var(--space-9); padding-top: var(--space-6); }
.report-section { display: grid; gap: var(--space-5); scroll-margin-top: calc(var(--header-height) + var(--report-nav-height) + var(--space-4)); }
.section-head { display: grid; gap: var(--space-2); justify-items: center; max-width: var(--reading-width); margin: 0 auto; text-align: center; }
.section-head h2 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); }
.section-lead { color: var(--muted); font-size: var(--fs-lg); text-wrap: balance; }

.bento { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.card {
  min-width: 0; display: grid; gap: var(--space-4); align-content: start;
  padding: var(--space-6) var(--space-5); background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow);
}
.card > * { min-width: 0; } /* 가로로 넘기는 줄(아이콘 필터·타임라인)이 카드를 넓히지 않게 */
.card-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); display: flex; align-items: center; flex-wrap: wrap; }
.card > .eyebrow + .card-title { margin-top: calc(var(--space-3) * -1); }
.term { display: inline-flex; align-items: center; }

@media (min-width: 760px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .span-full { grid-column: span 6; }
  .span-half { grid-column: span 3; }
  .span-third { grid-column: span 2; }
  .span-two-thirds { grid-column: span 4; }
  .card { padding: var(--space-7); }
  .section-head h2 { font-size: var(--fs-hero); }
}
@media (min-width: 760px) and (max-width: 979px) {
  .span-third { grid-column: span 3; }
  .span-third:last-child:nth-child(odd) { grid-column: span 6; }
  .span-two-thirds, .span-two-thirds + .span-third { grid-column: span 6; }
}

/* 프로필 */
.profile-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.profile-body { display: grid; gap: var(--space-2); justify-items: center; }
.profile-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.profile-headline { font-size: var(--fs-lg); color: var(--muted); }
.profile-facts { display: grid; gap: var(--space-1); margin: var(--space-2) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.profile-facts li { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.hashtags, .keywords { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: var(--space-2); }
.hashtag { padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); background: var(--bg); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
@media (min-width: 760px) {
  .profile-card { grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: var(--space-7); align-items: center; }
  .profile-body, .profile-facts li { justify-items: start; justify-content: flex-start; }
  .profile-card .hashtags { justify-content: flex-start; }
  .profile-title { font-size: var(--fs-3xl); }
}

/* 원국 표 */
.matrix-scroll { overflow-x: auto; margin: 0 calc(var(--space-2) * -1); }
.matrix { width: 100%; border-collapse: separate; border-spacing: var(--space-1); table-layout: fixed; font-size: var(--fs-sm); text-align: center; }
.matrix .corner { width: 5.4rem; }
.matrix th[scope='row'] { color: var(--muted); font-weight: var(--fw-medium); font-size: var(--fs-xs); text-align: left; }
.matrix thead th { color: var(--muted); font-weight: var(--fw-semibold); font-size: var(--fs-xs); padding-bottom: var(--space-1); }
.matrix td { padding: var(--space-2) var(--space-1); border-radius: var(--radius-sm); background: var(--surface-2); transition: box-shadow 0.2s, background 0.2s; }
.matrix .glyph-row td, .matrix thead td { padding: 0; background: transparent; }
.matrix td.hit { box-shadow: inset 0 0 0 var(--ring-width) var(--strong-ring); background: var(--bg); }
.matrix .glyph-row td.hit .glyph { box-shadow: 0 0 0 var(--ring-width) var(--strong-ring); }
.matrix .me { font-weight: var(--fw-bold); }
.palace-row td { background: transparent; display: table-cell; }
.palace-life { display: block; font-weight: var(--fw-semibold); font-size: var(--fs-xs); }
.palace-people { display: block; color: var(--faint); font-size: var(--fs-xs); }

.relations { display: grid; gap: var(--space-3); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap-size); padding: 0 var(--space-4);
  border: var(--border-width) solid var(--hair); border-radius: var(--radius-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.chip[aria-pressed='true'] { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip:disabled { color: var(--faint); background: transparent; cursor: default; }
.chip-count { min-width: 1.4em; padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--bg); color: var(--text); font-size: var(--fs-xs); }
.relation-detail { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.relation-detail li { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg); }

.report-actions { display: flex; justify-content: center; }
