/* Full Saju catalogue. Scoped to preserve the existing question scene. */
.full-result { display: grid; gap: 20px; font-size: 0.9375rem; overflow-wrap: anywhere; }
.full-result *, .full-previous-example { min-width: 0; }
.full-systems { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.full-system { min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft2); color: var(--muted); text-align: center; }
.full-system strong { font-size: 0.9375rem; font-weight: 600; }
.full-system span { font-size: 0.875rem; }
.full-system-active { background: var(--graphite); color: var(--bg, white); border-color: var(--graphite); } /* 8부 D5 B: 어둡게는 --graphite가 밝은색이라 글자를 바탕색(--bg)으로 뒤집는다. 밝게 --bg는 흰색이라 그대로 */
.full-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.full-heading h1 { margin: 0; }
.full-action { min-height: 44px; padding: 8px 12px; font-size: 0.875rem; line-height: 1.6; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; }
.full-action-primary { width: 100%; background: var(--graphite); color: white; border-color: var(--graphite); }
.full-message { margin: 0; display: grid; gap: 16px; padding: 20px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.full-message p { margin: 0; }
.full-overview { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.full-overview-row { display: grid; gap: 3px; }
.full-overview-row > strong { font-size: 0.875rem; color: var(--muted); font-weight: 500; }
.full-overview-value { font-size: 1rem; line-height: 1.7; }
.full-catalogue { display: grid; gap: 8px; }
.full-catalogue-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
.full-catalogue-heading h2 { margin: 0; font-size: 1.125rem; }
.full-catalogue-heading > span { color: var(--muted); font-size: 0.875rem; }
.full-group { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.full-group-heading, .full-item-heading { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; padding: 16px 38px 16px 14px; font-size: 0.9375rem; line-height: 1.6; list-style: none; }
.full-group-heading::-webkit-details-marker, .full-item-heading::-webkit-details-marker { display: none; }
.full-group-heading::after, .full-item-heading::after { content: "+"; position: absolute; right: 14px; top: 15px; font-size: 1.125rem; line-height: 24px; color: var(--muted); }
.full-group[open] > .full-group-heading::after, .full-item[open] > .full-item-heading::after { content: "−"; }
.full-group-heading > span:first-child { flex: 1 1 160px; font-weight: 600; }
.full-group-count { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.full-group-items { margin: 0 12px 12px; border-top: 1px solid var(--line); }
.full-item + .full-item { border-top: 1px solid var(--line); }
.full-item-heading { padding-left: 2px; padding-right: 28px; }
.full-item-heading::after { right: 2px; }
.full-item-name { flex: 1 1 100%; font-weight: 500; }
.full-status { display: inline-block; padding: 2px 7px; border-radius: 5px; color: var(--muted); background: var(--soft); font-size: 0.875rem; }
.full-item-body { display: grid; gap: 18px; padding: 0 2px 18px; font-size: 0.9375rem; }
.full-result-line { margin: 0; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-line; }
.full-item-id, .full-as-of, .full-source-id { margin: 0; font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.full-field { display: grid; gap: 7px; }
.full-field h4 { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.full-values { margin: 0; padding-left: 20px; }
.full-values > li + li { margin-top: 5px; }
.full-value-map { display: grid; gap: 8px; margin: 0; }
.full-value-row { display: grid; gap: 2px; padding-left: 10px; border-left: 1px solid var(--line2); }
.full-value-row dt { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.full-value-row dd { margin: 0; overflow-wrap: anywhere; }
.full-scalar { white-space: pre-wrap; overflow-wrap: anywhere; }
.full-detail-note, .full-missing { margin: 0; color: var(--muted); font-size: 0.875rem; }
.full-rule-detail { padding: 0 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft2); }
.full-rule-detail > summary { min-height: 44px; font-size: 0.875rem; line-height: 1.6; }
/* 9부 B5: 접힘이 좁아지면 그 안은 덜(아주 좁으면 더는) 들여 쓰지 않는다 — 320 큰 글씨에서 9겹을 열어도 글 칸 폭이 0이 되어
   글자가 한 글자씩 세로로 쌓이지 않게(8부 B08). 넓은 접힘은 그대로이고, 겹은 왼쪽 선으로 보인다.
   폭 질의 상자는 글 길이로 폭을 정할 수 없어서, 왼쪽 맞춤 세로 줄(.mirror-point-body 등) 안에서도 줄 폭을 채우게 한다. */
.full-rule-detail { container: full-fold / inline-size; align-self: stretch; }
@container full-fold (max-width: 15em) {
  .full-rule-detail { padding-inline: 6px 0; border-width: 0 0 0 1px; border-radius: 0; }
  .full-value-row { padding-left: 4px; }
  .full-values { padding-left: 0; list-style: none; }
}
@container full-fold (max-width: 9em) {
  .full-rule-detail { padding-left: 0; }
  .full-value-row { padding-left: 0; border-left-width: 0; }
}
.full-source { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft2); overflow-wrap: anywhere; }
.full-source-title { margin: 0; font-size: 0.875rem; font-weight: 600; }
.full-original { margin: 0; padding: 0; font-family: "Songti SC", "Noto Serif KR", serif; font-size: 1rem; line-height: 1.85; overflow-wrap: anywhere; }
.full-previous-example { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--line2); }
.full-previous-example > summary { font-size: 0.9375rem; min-height: 48px; }
.full-previous-example > div { margin-top: 12px; }
.system-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.system-tabs button { font: inherit; min-height: 56px; cursor: pointer; }
.system-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.system-modes [aria-pressed="true"] { border-color: var(--graphite); box-shadow: inset 0 -2px var(--graphite); }
.system-workspace input, .system-workspace select, .system-workspace textarea { box-sizing: border-box; max-width: 100%; min-height: 44px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card); padding: 8px 10px; font: inherit; color: var(--ink); }
.system-workspace textarea { width: 100%; min-height: 100px; }
.system-controls { gap: 12px; }
.system-controls .field-label { display: grid; gap: 6px; }
.system-check { display: flex; gap: 10px; align-items: center; }
.system-search { width: 100%; }
.system-raw { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.875rem; line-height: 1.7; }
.system-source-list, .system-saved { display: grid; gap: 12px; }
.full-sources > summary { min-height: 44px; padding: 8px 0; }
.system-hexagram { display: grid; gap: 9px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.system-hex-line { display: grid; grid-template-columns: 40px minmax(60px, 140px) 40px; justify-content: center; align-items: center; gap: 12px; font-size: 0.875rem; }
.system-line-bars { display: flex; gap: 14px; }
.system-line-bars i { display: block; height: 9px; background: var(--graphite); flex: 1; }
.system-line-bars.yang { gap: 0; }
.system-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }
.system-card { margin: 0; display: grid; align-content: start; gap: 8px; }
.system-card img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.system-card figcaption { font-size: 0.9375rem; line-height: 1.7; }
.system-library { display: grid; gap: 12px; }
.system-card-reversed { transform: rotate(180deg); }
.system-controls { margin: 0; }
.system-controls legend { padding: 0 5px; }
.system-controls:disabled { opacity: .65; }
.system-card-back { width: 72px; height: 120px; object-fit: contain; justify-self: center; }
.system-gua-grid, .system-data-list { display: grid; gap: 12px; }
.system-gua-card h3, .system-natal-card h3 { margin: 0 0 8px; font-size: 0.9375rem; }
.system-gua-card .system-hexagram { padding: 12px 0; }
.system-natal-details { display: grid; gap: 20px; }
.system-natal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.system-natal-card { display: grid; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.system-natal-card p { margin: 5px 0; }
.system-natal-details p, .system-natal-details summary { font-size: 0.9375rem; }
.system-natal-details .system-data-list { padding-left: 20px; }
.ziwei-chart { min-width: 0; display: grid; gap: 18px; }
.ziwei-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; width: 100%; }
.ziwei-center { grid-area: 2 / 2 / 4 / 4; display: grid; align-content: center; padding: 10px; text-align: center; }
.ziwei-palace { min-width: 0; min-height: 112px; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; padding: 8px 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: inherit; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.ziwei-palace span { max-width: 100%; }
.ziwei-palace[data-branch="巳"] { grid-area: 1 / 1; }
.ziwei-palace[data-branch="午"] { grid-area: 1 / 2; }
.ziwei-palace[data-branch="未"] { grid-area: 1 / 3; }
.ziwei-palace[data-branch="申"] { grid-area: 1 / 4; }
.ziwei-palace[data-branch="辰"] { grid-area: 2 / 1; }
.ziwei-palace[data-branch="酉"] { grid-area: 2 / 4; }
.ziwei-palace[data-branch="卯"] { grid-area: 3 / 1; }
.ziwei-palace[data-branch="戌"] { grid-area: 3 / 4; }
.ziwei-palace[data-branch="寅"] { grid-area: 4 / 1; }
.ziwei-palace[data-branch="丑"] { grid-area: 4 / 2; }
.ziwei-palace[data-branch="子"] { grid-area: 4 / 3; }
.ziwei-palace[data-branch="亥"] { grid-area: 4 / 4; }
.ziwei-palace[data-relation="selected"] { border: 2px solid var(--accent, #695b46); background: #f2ede5; }
.ziwei-palace[data-relation="opposite"], .ziwei-palace[data-relation="trine"] { border: 2px solid #8b806d; }
.ziwei-palace[data-relation="neighbor"] { border: 2px dashed #8b806d; }
.ziwei-relation { min-height: 1.5em; }
.system-controls { display: grid; }
.system-workspace [hidden] { display: none !important; }
@media (min-width: 640px) {
  .system-gua-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ziwei-period-marker {
  display: block;
  padding: .15rem .25rem;
  border: 1px solid currentColor;
  border-radius: .3rem;
  overflow-wrap: anywhere;
}
.ziwei-year-controls input { width: 8rem; max-width: 100%; }
.ziwei-year-reading { min-width: 0; overflow-wrap: anywhere; }
.ziwei-presentation { display: grid; gap: 24px; min-width: 0; }
.ziwei-user-reading { gap: 22px; min-width: 0; }
.ziwei-user-reading h2 { margin: 0; }
.ziwei-user-reading > .full-field > h2 { font-size: 1.0625rem; }
.ziwei-reading-lead { display: grid; gap: 8px; padding: 16px; border-left: 3px solid var(--graphite); background: var(--soft); }
.ziwei-user-reading > .full-field .full-result-line { font-weight: 400; }
.ziwei-user-reading .full-detail-note { line-height: 1.7; }
.ziwei-palace-detail:empty { display: none; }
.display-term { margin: 8px 0; min-width: 0; overflow-wrap: anywhere; }
.display-term > summary { line-height: 1.6; }
.display-term-definition, .display-term-reason { margin: 8px 0; line-height: 1.65; }
.display-term-value { min-width: 0; overflow-wrap: anywhere; }
.display-term-value > h4 { margin: 8px 0 4px; }
.display-unresolved { min-width: 0; }
[data-display-target="duplicate"] { scroll-margin-top: var(--mirror-top-offset, 0px); }
@media (max-width: 480px) {
  .display-term p, .display-term-value, .display-term summary { font-size: 1rem; }
  .display-term-value > h4, .display-unresolved > details > summary { font-size: 0.875rem; }
  .birth-card .subtitle, .birth-card legend, .birth-card summary,
  .birth-card .note, .birth-card .form-note { font-size: 0.875rem; }
}
