.bar{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap}.bar label,.controls label{font-size:.9rem}.bar label{margin:0}.bar h2{margin-right:auto}.bar input,.controls input[type=search]{display:block;width:100%;max-width:100%;min-width:0;background:var(--bg);color:var(--text);padding:.55rem;border:1px solid var(--border-2);border-radius:7px}.bar label:first-child{max-width:250px}.bar select,.controls select{max-width:260px}.workspace{margin-top:1rem;grid-template-columns:1fr 1fr}.scroll{overflow:auto;border-radius:8px;background:#eff0e2;margin:.8rem 0}#tree{height:auto;display:block;width:100%}.controls a,main a{color:inherit}#rel button{margin:.2rem .3rem .2rem 0}#name{font-size:1.5rem}#path li{padding:.35rem}#tree [role=button]{cursor:pointer}#tree [role=button]:focus rect{stroke:#b17716;stroke-width:3}.plan p,#status{overflow-wrap:anywhere}@media(max-width:680px){.workspace{grid-template-columns:1fr}.bar label{max-width:100%}.bar select{max-width:100%}}@media print{@page{size:A4 landscape;margin:10mm}html,body,main{background:white;color:black;width:100%;margin:0;padding:0}main>:not(.preview){display:none}.preview{border:0;padding:0;background:white}.preview>.bar{display:none}.scroll{overflow:visible;margin:0}#tree{width:100%!important;min-width:0!important;max-height:178mm}}

/* 어두운 테마: 밝은 종이색 가계도가 넓게 눈부시던 것. 화면에서만 낮추고, 인쇄와 SVG 저장은 원래 밝은 색 그대로 */
@media screen{
:root:not([data-theme="light"]) .scroll{background:#1c2019}
:root:not([data-theme="light"]) #tree .bg{fill:#1c2019}
:root:not([data-theme="light"]) #tree .card{fill:#2a3326;stroke:#56664f}
:root:not([data-theme="light"]) #tree .card.root{fill:#3d4c34}
:root:not([data-theme="light"]) #tree .t1{fill:#e8efe2}
:root:not([data-theme="light"]) #tree .t2{fill:#b9c7b2}
:root:not([data-theme="light"]) #tree .edge{stroke:#6f8569}
:root:not([data-theme="light"]) #tree [role=button]:focus rect{stroke:#f59e0b}
}
.hint,.reference{font-size:.86rem;color:var(--text-3)}#status{color:var(--text-2)}
/* 폰: 파일 고르기와 예시 단추, 검색과 기준 인물을 두 칸씩 놓아 가계도가 덜 밀리게 */
@media(max-width:680px){.controls.bar{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:.6rem}.controls.bar label{min-width:0}.controls.bar select{width:100%}#demo{min-height:44px}}
