/* Compact relationship picker and chart summaries; calculation/result styles stay shared. */
#tab-hepan .hp-relations,
#tab-hepan .hp-form { padding: 18px; }
#tab-hepan .hp-relations .card-title,
#tab-hepan .hp-form .card-title { flex-wrap: wrap; gap: 6px 12px; }
#tab-hepan .hp-relations .card-title .src,
#tab-hepan .hp-form .card-title .src { line-height: 1.6; }
#tab-hepan .hp-rel-grid { grid-template-columns: 1fr; gap: 8px; }
#tab-hepan .hp-rel-cat { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 8px; }
#tab-hepan .hp-rel-cat-label { padding: 0; letter-spacing: .5px; line-height: 1.4; }
#tab-hepan .hp-rel-cat-btns,
#tab-hepan .hp-rel-cat:last-child .hp-rel-cat-btns { display: flex; flex-wrap: wrap; gap: 6px; }
#tab-hepan .hp-rel-btn { flex-direction: row; gap: 6px; min-height: 44px; padding: 8px 13px; border-radius: 24px; transform: none; }
#tab-hepan .hp-rel-icon { font-size: 15px; }
#tab-hepan .hp-rel-label { font-size: 12px; line-height: 1.4; }
#tab-hepan .hp-rel-btn.active .hp-rel-label { color: var(--xq-state-text, var(--ink)); }
#tab-hepan .hp-relation-description { margin: 0 0 14px; }
#tab-hepan .hp-form-grid { grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); gap: 0; align-items: start; }
#tab-hepan .hp-side { padding: 14px; gap: 12px; border-radius: 14px; }
#tab-hepan .hp-side-label { padding-bottom: 10px; letter-spacing: .5px; }
#tab-hepan .hp-badge { width: 24px; height: 24px; flex: 0 0 24px; }
#tab-hepan .hp-side-info { flex: none; justify-content: flex-start; gap: 8px; }
#tab-hepan .hp-side-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; font-size: 16px; line-height: 1.5; }
#tab-hepan .hp-side-name > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#tab-hepan .hp-side-gender { flex: none; color: var(--ink-faint); font-size: 11px; font-weight: 400; }
#tab-hepan .hp-side-birth { line-height: 1.6; }
#tab-hepan .hp-side-pillars { gap: 5px; margin: 4px 0; }
#tab-hepan .hp-side-pillars > span { gap: 5px; padding: 8px 2px; border-radius: 7px; }
#tab-hepan .hp-side-pillars small { font-size: 10px; }
#tab-hepan .hp-side-pillars strong { font-size: 21px; white-space: nowrap; }
#tab-hepan .hp-side-day { font-size: 12px; line-height: 1.6; }
#tab-hepan .hp-saved-picker > label { font-size: 11px; }
#tab-hepan .hp-saved-picker .hp-source-note { margin-top: 6px; font-size: 10px; line-height: 1.6; }
#tab-hepan .hp-record-preview { gap: 8px; padding-top: 10px; }
#tab-hepan .hp-record-preview .hp-source-note { margin: 0; }
#tab-hepan .hp-manual-preview { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
#tab-hepan .hp-manual-preview strong { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
#tab-hepan .hp-manual-preview > span { color: var(--ink-faint); font-size: 11px; }
#tab-hepan .hp-vs { height: 28px; align-self: start; margin-top: 96px; }
#tab-hepan .hp-vs::before { display: none; }
#tab-hepan .hp-vs-circle { width: 24px; height: 24px; border: 0; background: transparent; box-shadow: none; }
#tab-hepan .hp-vs-circle::before,
#tab-hepan .hp-vs-circle::after { top: 7px; width: 11px; height: 11px; }
#tab-hepan .hp-vs-circle::before { left: 3px; }
#tab-hepan .hp-vs-circle::after { right: 3px; }
#tab-hepan .hp-manual-panel { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
#tab-hepan .hp-manual-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 0; list-style: none; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; }
#tab-hepan .hp-manual-panel > summary::-webkit-details-marker { display: none; }
#tab-hepan .hp-manual-panel > summary::after { content: '+'; color: var(--ink-faint); font-size: 18px; font-weight: 400; }
#tab-hepan .hp-manual-panel[open] > summary::after { content: '−'; }
#tab-hepan .hp-manual-panel > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
#tab-hepan .hp-manual-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; padding-top: 4px; }
#tab-hepan .hp-identity-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) minmax(100px,.45fr); gap: 12px; }
#tab-hepan .hp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#tab-hepan .hp-field-label { min-height: 18px; font-size: 11px; line-height: 1.6; }
#tab-hepan .hp-field .hp-input { flex: none; }
#tab-hepan .hp-date-fields { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr); gap: 6px; min-width: 0; }
#tab-hepan .hp-input { min-height: 44px; max-width: 100%; padding: 9px 10px; font-size: 16px; text-overflow: ellipsis; }
#tab-hepan .hp-form-actions { margin-top: 16px; padding-top: 14px; gap: 16px; }
#tab-hepan .hp-form-actions p { max-width: 31em; }
#tab-hepan .hp-form-actions .hp-run { min-height: 46px; min-width: 168px; border-radius: 12px; }

@media (max-width: 600px) {
  #tab-hepan .hp-relations,
  #tab-hepan .hp-form { padding: 14px; }
  #tab-hepan .hp-rel-cat { grid-template-columns: 30px minmax(0,1fr); gap: 6px; }
  #tab-hepan .hp-rel-btn { padding: 8px 11px; }
  #tab-hepan .hp-relations .card-title .src,
  #tab-hepan .hp-form .card-title .src { flex-basis: 100%; margin-left: 0; }
  #tab-hepan .hp-form-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  #tab-hepan .hp-vs { display: none; }
  #tab-hepan .hp-side { padding: 12px; gap: 10px; }
  #tab-hepan .hp-side-label { padding-bottom: 8px; }
  #tab-hepan .hp-side-pillars > span { padding: 7px 2px; }
  #tab-hepan .hp-side-pillars strong { font-size: 22px; }
  #tab-hepan .hp-manual-fields { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #tab-hepan .hp-identity-fields { grid-template-columns: minmax(0,1fr) minmax(78px,.45fr); gap: 10px; align-items: end; }
  html[data-xunq-lang="en"] #tab-hepan .hp-identity-fields { grid-template-columns: minmax(0,1fr) 110px; }
  #tab-hepan .hp-form-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  #tab-hepan .hp-form-actions .hp-run { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #tab-hepan .hp-rel-btn,
  #tab-hepan .hp-run { transition: none; }
}

/* The SVG overlays both charts and must not consume a grid column. */
#tab-hepan .hp-pan-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
#tab-hepan .hp-pan { min-width: 0; }
#tab-hepan .mini-pan { grid-template-columns: 24px repeat(4, minmax(0, 1fr)); }
#tab-hepan .mini-pillar { min-width: 0; }
#tab-hepan .hp-pan-card > .card-title { flex-wrap: wrap; gap: 6px 12px; }
@media (max-width: 640px) {
  #tab-hepan .hp-pan-wrap { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #tab-hepan .hp-pan-card > .card-title .src { display: none; }
}
