main{max-width:1300px;margin:auto;padding:1.5rem}h1{font-size:clamp(2rem,5vw,3.25rem);margin:.3em 0}header nav,.toolbar{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.toolbar{margin:1.4rem 0}.toolbar select,.editor input{font:inherit;padding:.65rem;border:1px solid #9daea3;border-radius:.5rem;background:white;min-width:0}.toolbar select{max-width:min(100%,18rem)}
.workspace{display:grid;grid-template-columns:15rem minmax(0,1fr);gap:1rem}.editor,.canvas{border:1px solid #cdd6cd;border-radius:1rem;background:white}.editor{padding:1rem;display:grid;align-content:start;gap:.55rem}.editor form{display:grid;gap:.5rem}.editor label,.toolbar label{font-weight:650}.editor small{line-height:1.5;color:#486052}.primary{background:#345647;color:white}
.canvas{overflow:hidden;background-color:#f8faf6;background-image:radial-gradient(#d9e1d8 1px,transparent 1px);background-size:16px 16px}#scroll{overflow:auto;max-height:65vh;min-height:190px}#map{display:block;margin:auto;min-width:100%;font:15px system-ui,sans-serif}.node{cursor:pointer}.node .outline{fill:var(--bubble-fill);stroke:var(--bubble-border);stroke-width:1.5}.node text{fill:var(--bubble-ink)}.node[aria-pressed=true] .outline,.node:focus-visible .outline{stroke:#a4542c;stroke-width:3}.edge{stroke:#718d7e;stroke-width:2;fill:none}
@media(max-width:720px){main{padding:1rem}.workspace{display:flex;flex-direction:column-reverse}.editor{grid-template-columns:1fr 1fr}.editor form,.editor small{grid-column:1/-1}#scroll{min-height:150px;max-height:42vh}}
@page{size:A4 landscape;margin:9mm}
@media print{body>*:not(main),main>*:not(.workspace),.editor{display:none!important}html,body,main,.workspace,.canvas,#scroll{display:block!important;background:white!important;border:0!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;min-height:0!important;max-height:none!important;overflow:visible!important}#map{width:100%!important;height:185mm!important;min-width:0!important;print-color-adjust:exact}.node[aria-pressed=true] .outline{stroke:#789382;stroke-width:1.5}}
.maptools{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;background:#fff;border-bottom:1px solid #cedbce;padding:.5rem}.maptools button{min-height:40px}.editor button[aria-pressed=true]{background:#36584a;color:white}#relations:empty{display:none}#relations button{font-size:.85rem}#scroll{height:clamp(280px,58vh,680px);max-height:none;overflow:hidden}#map{width:100%;height:100%;touch-action:none;user-select:none;cursor:grab}.node{cursor:grab}.edge.extra{stroke:#95512d;stroke-width:2.5}.canvas{align-self:start;width:100%}#mode{font-size:.9rem}@media(max-width:720px){#scroll{height:45svh;min-height:250px}}@media print{.maptools{display:none!important}#scroll{height:auto!important}}

.appearance{grid-column:1/-1}.appearance summary{cursor:pointer;padding:.6rem 0;font-weight:650}.appearance label{display:block;margin:.6rem 0 .2rem}.appearance select{font:inherit;width:100%;padding:.5rem;background:white;color:inherit;border:1px solid #9daea3;border-radius:.5rem}

.bubble-colors{grid-column:1/-1;margin:0;padding:.35rem 0;border:0;min-width:0}
.bubble-colors legend{font-weight:650}
#colors{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.25rem}
.editor #colors button{background:var(--swatch);color:var(--ink);min-height:44px;border:1px solid #64736a;border-radius:.55rem;font-weight:750}
#colors button[aria-pressed=true]::after{content:'✓'}
#colors button:focus-visible{outline:3px solid #183f66;outline-offset:1px}
#color-branch{margin-top:.5rem}
