*{box-sizing:border-box}:root{font-family:'Segoe UI',Inter,Arial,sans-serif;color:#233d31;background:#fafbf7;font-size:14px;--forest:#294b3c;--line:#e1e6de;--muted:#7b897f}body{margin:0;display:grid;grid-template-columns:68px minmax(0,1fr);grid-template-rows:72px minmax(0,1fr);height:100vh;height:100dvh;overflow:hidden}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;background:#fff;border:1px solid var(--line);border-radius:9px;padding:9px 13px;transition:background .15s,border-color .15s;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover{background:#edf2e9}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #507454;outline-offset:3px}button:disabled{opacity:.35;cursor:default}button img{width:20px;height:20px;pointer-events:none;flex-shrink:0}input,textarea,select{min-width:0;border:1px solid var(--line);background:#fff;border-radius:7px;padding:10px;width:100%}textarea{resize:vertical}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.icon-button{width:40px;height:40px;padding:8px;border:0;background:transparent;flex-shrink:0}.icon-button img{width:24px;height:24px}.icon-button.active{background:#e7efdf}.app-header{grid-column:1/-1;display:flex;align-items:center;height:72px;padding:0 24px;gap:28px;border-bottom:1px solid var(--line);background:#fdfefa;z-index:10}.brand{display:flex;align-items:center;gap:13px;color:#203e30;font-size:25px;font-weight:700;letter-spacing:-.7px;text-decoration:none;padding-right:34px;border-right:1px solid #cdd5cb;white-space:nowrap}.brand img{width:32px;height:32px}.map-heading{display:flex;align-items:center;gap:0;min-width:0;flex:1}#mapTitle{border:0;background:transparent;font-size:21px;font-weight:500;width:270px;max-width:calc(100% - 34px);padding:8px 4px;border-radius:5px}#mapTitle:hover{background:#f0f3ed}#mapMenu{width:30px}.header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0}#saveState{font-size:12px;color:#5f7765;white-space:nowrap}#export{background:transparent;border-color:#ccd5cb;min-height:42px;font-size:13px;white-space:nowrap}#aiToggle{order:3;min-height:42px;min-width:114px}.rail{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:center;gap:22px;padding:20px 0;border-right:1px solid var(--line);background:#fdfefa;z-index:9}.rail .primary-icon{background:#294b3c;border-radius:50%;width:28px;height:28px;padding:5px;margin:4px 0}.primary-icon img{filter:brightness(0) invert(1);width:20px;height:20px}.rail-bottom{margin-top:auto}.library{position:fixed;z-index:9;left:68px;top:72px;bottom:0;width:288px;padding:21px 18px;display:flex;flex-direction:column;background:#fafbf7;border-right:1px solid var(--line);box-shadow:9px 0 28px #233d3110}.drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px}.drawer-heading h2{margin:0;font-size:19px;font-weight:600}.drawer-heading .icon-button{width:32px;height:32px}.library-actions{display:flex;gap:7px}.library-actions button:first-child{flex:1;background:var(--forest);color:white;border-color:var(--forest)}.library-actions button:first-child img{filter:brightness(0) invert(1)}.library-actions button:last-child{border:1px solid var(--line)}.root{margin:20px 0 10px;text-align:left;justify-content:flex-start;background:none;border:0}.root.active{background:#e6ecdf}#tree{overflow:auto;flex:1}.tree-row{display:flex;align-items:center;gap:3px;margin:4px 0;border-radius:7px;min-width:0}.tree-row.active{background:#e6ecdf}.tree-row>button{border:0;background:none;text-align:left;padding:9px 5px;justify-content:flex-start}.tree-row .entry{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.library-bottom{border-top:1px solid var(--line);padding-top:15px}.library-bottom button{background:none;border:0;font-size:12px;padding:8px 3px;display:flex;justify-content:flex-start}.library-bottom button img{width:17px;height:17px}.library-bottom small{font-size:10px;color:#7a887a;display:block;line-height:1.6;margin-top:14px}main{grid-column:2;grid-row:2;min-width:0;min-height:0;display:flex;flex-direction:column}.workspace{position:relative;flex:1;min-height:0;overflow:hidden;background-color:#fafbf7;background-image:radial-gradient(#dae3d8 .65px,transparent .65px);background-size:24px 24px}#canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}#canvas:active{cursor:grabbing}.toolbar{position:absolute;z-index:2;top:20px;left:20px;display:flex;align-items:center;gap:7px;background:#fdfefa;padding:8px 10px;border:1px solid #e1e6dd;border-radius:12px;box-shadow:0 3px 14px #283f330b;white-space:nowrap}.toolbar i,.zoom i,#quickFormat i{height:24px;border-left:1px solid var(--line);margin:0 3px}.toolbar .icon-button{width:39px;height:39px}.toolbar #undo,.toolbar #redo{width:30px}.toolbar #undo img,.toolbar #redo img{width:20px;height:20px}.eyebrow{font-size:10px;font-weight:650;letter-spacing:1.4px;color:#7c8b77}#empty{position:absolute;top:48%;left:50%;transform:translate(-50%,-50%);text-align:center;width:90%;pointer-events:none}.empty-mark{width:48px;height:48px;opacity:.5;margin-bottom:12px}h1{font-size:30px;font-weight:500;letter-spacing:-.7px;margin:14px 0}#empty p{color:#7d8979;font-size:14px;line-height:1.7}#empty button{pointer-events:auto;background:var(--forest);color:white;border:0;margin-top:15px;padding:13px 20px}#empty button img{filter:brightness(0) invert(1)}.canvas-footer{position:absolute;bottom:20px;left:20px;right:20px;display:flex;align-items:center;justify-content:space-between;pointer-events:none;gap:12px}.canvas-footer>span{font-size:11px;color:#84928a}.zoom{display:flex;align-items:center;background:#fdfefa;border:1px solid var(--line);border-radius:12px;pointer-events:auto;padding:5px 7px;box-shadow:0 2px 12px #283f3308}.zoom button{border:0;background:transparent;font-size:13px;padding:8px 12px}.zoom .icon-button{width:34px;height:34px;padding:7px}.zoom .icon-button img{width:18px;height:18px}.zoom span{font-size:12px;min-width:38px;text-align:center;font-variant-numeric:tabular-nums}.zoom i{height:20px}.inspector{position:fixed;z-index:7;right:20px;top:92px;bottom:20px;width:290px;border:1px solid var(--line);border-radius:13px;padding:20px;background:#fdfefa;overflow:auto;box-shadow:0 8px 36px #233d3118}.inspector label{display:block;font-size:10px;font-weight:600;letter-spacing:.9px;color:#6c7f6e;margin-bottom:18px}.inspector label input,.inspector label select,.inspector label textarea{display:block;margin-top:7px;color:#294b3c;letter-spacing:0;font-size:13px;font-weight:400}.style-row{display:flex;gap:8px;align-items:center}.style-row label{flex:1}.style-row button.active{background:#dce8d2;border-color:#8da57c}.inspector .color-row{display:flex;align-items:center;justify-content:space-between;letter-spacing:0;font-size:12px;margin-bottom:14px}.inspector input[type=color]{width:38px;height:30px;padding:3px;margin:0}.dimensions{display:flex;gap:10px}.dimensions label{min-width:0}.danger{width:100%;color:#a75c51;background:#fff8f5;border-color:#f1ded7}.hint{font-size:11px;color:#7c897b;line-height:1.8}#quickFormat{position:absolute;z-index:4;display:flex;align-items:center;gap:3px;padding:7px 8px;background:#fdfefa;border:1px solid var(--line);border-radius:11px;box-shadow:0 3px 16px #263b3012;max-width:calc(100% - 24px)}#quickFormat .icon-button{width:32px;height:32px;padding:6px}#quickFormat .icon-button img{width:20px;height:20px}.quick-size input{width:52px;padding:5px;border-color:#e5e9e0;font-size:13px;height:32px}.quick-color{width:30px;height:32px;display:flex;align-items:center;justify-content:center}.quick-color input{appearance:none;-webkit-appearance:none;border:0;background:transparent;width:23px;height:23px;padding:1px;cursor:pointer}.quick-color input::-webkit-color-swatch-wrapper{padding:0}.quick-color input::-webkit-color-swatch{border:1px solid #78956d;border-radius:50%}.border-swatch input::-webkit-color-swatch{border:4px solid #fff;outline:2px solid currentColor;border-radius:3px}.node{cursor:move}.port{opacity:0;cursor:pointer}.node:hover .port{opacity:0}.node .port:hover,.node .port:focus{opacity:1}.port circle{fill:#fafbf7;stroke:#6f9160;stroke-width:1.4}.port text{fill:#294b3c;font:18px 'Segoe UI',Arial;pointer-events:none}.selection{fill:none;stroke:#557c45;stroke-width:1.5;pointer-events:none}#picker{position:absolute;background:#fdfefa;z-index:6;padding:14px;border:1px solid var(--line);border-radius:11px;box-shadow:0 10px 35px #273c3420;width:190px}#picker button{display:flex;width:100%;justify-content:flex-start;border:0;margin-top:5px}#printArea{display:none}
.inline-editor{position:absolute;z-index:4;transform:translate(-50%,-50%);margin:0;padding:0;border:0;border-radius:3px;outline:2px solid #819b6b;outline-offset:4px;resize:none;line-height:1.3;font-family:Segoe UI,Arial,sans-serif;text-align:center;min-width:0;overflow:auto;box-shadow:0 0 0 5px #ffffff70}
.tree-row .entry{min-width:65px}.tree-row .row-action{padding:6px 4px;font-size:14px;opacity:0}.tree-row .add-inside{opacity:1}.tree-row:hover .row-action,.tree-row:focus-within .row-action{opacity:1}.tree-row{min-width:190px}.tree-row.dragging{opacity:.4}.tree-row.drop-target,#root.drop-target{background:#dcebd0;outline:2px solid #6b8b55;outline-offset:-2px}.library-dialog{border:1px solid #dce4d4;border-radius:12px;padding:24px;width:340px;color:#30483a}.library-dialog::backdrop{background:#203d332e}.library-dialog h2{margin:0 0 20px;overflow-wrap:anywhere}.library-dialog label{font-size:12px}.library-dialog select{margin-top:10px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.folder-choice{display:block;width:100%;text-align:left;margin-bottom:12px}
#tree{overflow-x:hidden}.tree-row{min-width:0;width:100%;gap:0;margin-left:0}.tree-row .entry{min-width:0;flex:1;text-overflow:ellipsis}.tree-row>button{flex-shrink:0}.tree-row .row-action{opacity:1;width:25px;padding:6px 3px;text-align:center}.tree-row .item-menu{font-size:20px}.tree-row .entry{cursor:grab}.tree-row.dragging .entry{cursor:grabbing}#folderContext{font-size:10px;line-height:1.5;margin:0 5px 10px;color:#7d8b77;overflow-wrap:anywhere}.library-dialog p{font-size:13px;line-height:1.7}.library-dialog .dialog-actions .danger{width:auto}.delete-choice{color:#a75c51}
.folder-children{margin-left:10px;padding-left:8px;border-left:1px solid #cdd8c3}.folder-toggle{width:22px;font-size:17px;text-align:center!important;color:#5b7650}.empty-folder{padding:8px 4px;font-size:10px;line-height:1.5;color:#84917b}.folder-row .entry{font-weight:550}.folder-children .tree-row{margin-top:2px;margin-bottom:2px}
.ai-activity{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:10px;flex-shrink:0;padding:12px;margin:4px 0 14px;border:1px solid #b8cba9;border-radius:10px;background:#eaf2e3;color:#304f3f}.ai-activity>div{min-width:0;flex:1}.ai-activity strong{display:block;font-size:13px}.ai-activity #aiActivityDetail{display:block;font-size:11px;line-height:1.5;margin-top:3px}.ai-spinner{width:23px;height:23px;flex:0 0 23px;border:3px solid #c2d2b8;border-top-color:#304f3f;border-radius:50%;animation:ai-spin .85s linear infinite}#aiElapsed{font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap}#aiStop{padding:6px 9px;font-size:11px;flex-shrink:0}#aiToggle.ai-working{outline:2px solid #adc599;outline-offset:3px}@keyframes ai-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.ai-spinner{animation:none;border-top-color:#304f3f;border-right-color:#304f3f}}
#aiToggle{background:#304f3f;color:white;border-color:#304f3f;white-space:nowrap}#aiPanel{position:fixed;z-index:8;right:18px;top:100px;bottom:18px;width:390px;max-width:calc(100vw - 30px);padding:22px;display:flex;flex-direction:column;background:#fafbf7;border:1px solid #cbd8c1;border-radius:14px;box-shadow:0 12px 60px #253d3430;overflow:auto}.ai-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.ai-heading h2{margin:8px 0 12px}.ai-heading button{border:0;background:none;font-size:22px;padding:0 5px}.ai-top{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11px;color:#728268}.ai-top button{font-size:11px;padding:6px 9px}.ai-intro{font-size:13px;line-height:1.6;color:#65775d}#aiMessages{overflow:auto;flex:1;min-height:100px;margin:8px 0 15px}.ai-message{padding:12px;margin-bottom:10px;background:white;border:1px solid #e0e6d8;border-radius:10px}.ai-message.user{background:#eaf1e2}.ai-message strong{font-size:11px;color:#698059}.ai-message p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6;margin:6px 0 0}.ai-note{font-size:10px;color:#78856e;line-height:1.5;margin:8px 0}.ai-label{font-size:11px}.ai-label select{font-size:12px;margin-top:6px}.ai-buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}#aiSend{background:#304f3f;color:white}#aiPrompt{font-size:13px;line-height:1.5;resize:vertical;min-height:80px}#aiPending{background:#fff5e4;border:1px solid #dbc6a0;padding:12px;border-radius:8px;margin-bottom:12px}#aiPending p{white-space:pre-wrap;font-size:12px;max-height:130px;overflow:auto}#aiPending button{font-size:11px;margin:3px}.ai-settings{width:460px;max-width:95vw}.ai-settings label{display:block;margin:14px 0 6px}.ai-settings input{margin-top:6px}.ai-settings small{font-size:11px;color:#7d8b77}.ai-settings .dialog-actions{flex-wrap:wrap}#aiSettingsError{color:#a64e3b}@media print{#aiPanel{display:none!important}}

/* Desktop canvas layout overrides for the retained AI and library components. */
#aiPanel{top:88px;right:16px;bottom:16px;width:390px;border-color:var(--line);background:#fafbf7;box-shadow:0 8px 40px #253d3420}#aiToggle{font-size:13px;background:#294b3c;border-color:#294b3c;color:#fff}#aiToggle img{filter:brightness(0) invert(1)}.library-dialog{max-width:calc(100vw - 32px)}.selection{stroke-dasharray:none}#noSelection{font-size:13px;color:var(--muted)}.inline-editor{font-family:'Segoe UI',Arial,sans-serif}body:has(#aiPanel:not([hidden])) #inspector{display:none}
@media(max-width:1000px){.app-header{gap:16px;padding:0 18px}.brand{font-size:22px;padding-right:20px;gap:9px}.brand img{width:28px}.header-actions{gap:9px}#saveState{display:none}#mapTitle{width:220px}.canvas-footer>span{display:none}.canvas-footer{justify-content:flex-end}}
@media(max-width:700px){body{grid-template-columns:52px minmax(0,1fr);grid-template-rows:64px minmax(0,1fr)}.app-header{height:64px;padding:0 10px;gap:8px}.brand{font-size:0;padding-right:8px;gap:0}.brand img{width:27px;height:27px}#mapTitle{font-size:16px;width:150px}#export{font-size:11px;padding:8px;min-height:36px}#aiToggle{min-width:78px;min-height:36px;padding:8px;font-size:11px}.header-actions{gap:6px}.rail{padding-top:16px;gap:20px}.library{left:52px;top:64px;width:min(288px,calc(100vw - 52px))}.toolbar{left:12px;top:12px;gap:1px;padding:5px}.toolbar .icon-button{width:31px;height:34px}.toolbar .icon-button img{width:21px;height:21px}.toolbar #undo,.toolbar #redo{width:27px}.toolbar i{margin:0 2px}.canvas-footer{left:12px;right:12px;bottom:12px}.zoom{padding:3px}.zoom button{padding:7px 9px}.inspector{top:76px;right:12px;bottom:12px;width:min(290px,calc(100vw - 76px))}#aiPanel{top:76px;right:12px;bottom:12px;max-width:calc(100vw - 24px);padding:18px}#quickFormat{gap:0;padding:5px}#quickFormat .icon-button{width:28px}.quick-color{width:27px}.quick-size input{width:48px}}
@media print{@page{size:A3 landscape;margin:12mm}body{display:block;height:auto;background:white;overflow:visible}.app-header,.rail,.library,main,.inspector,#aiPanel{display:none!important}#printArea{display:block;width:100%}#printArea h1{font:20px 'Segoe UI';margin:0 0 15px}#printArea svg{width:100%;height:245mm}.port,.selection{display:none!important}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.node:focus{outline:none}.node:focus-visible{outline:2px solid #70965b;outline-offset:6px}.node .port:hover,.node .port:focus{opacity:1}.toolbar [data-add=rounded] img{transform:scaleY(.72)}.toolbar [data-add=ellipse] img{transform:scaleY(.85)}#mapTitle{field-sizing:content;width:auto;min-width:120px;max-width:min(370px,calc(100% - 34px));font-weight:400}#saveState{font-size:13px}.brand img{filter:invert(23%) sepia(19%) saturate(1124%) hue-rotate(96deg) brightness(92%)}

/* Connect existing ideas and exchange positions without changing their content. */
#quickFormat .idea-action{border:0;background:transparent;font-size:12px;padding:6px 8px;gap:4px;height:32px;white-space:nowrap}#quickFormat .idea-action:hover{background:#e7efdf}#quickFormat .idea-action img{width:18px;height:18px}#interactionStatus{position:absolute;z-index:6;left:50%;bottom:82px;transform:translateX(-50%);display:flex;align-items:center;gap:16px;padding:12px 16px;border:1px solid #b8cba9;border-radius:12px;background:#f3f8ed;box-shadow:0 3px 16px #263b3015;max-width:calc(100% - 32px);font-size:13px}#interactionStatus button{padding:6px 10px}#picker hr{border:0;border-top:1px solid #e1e6de;margin:12px 0}#picker{width:220px}.connect-mode .node,.swap-mode .node{cursor:crosshair}.connect-mode .node:not(.action-source):hover> :first-child,.swap-mode .node:not(.action-source):hover> :first-child{stroke:#294b3c;stroke-width:3}.action-source> :first-child{stroke-dasharray:7 4}.connect-mode .port,.swap-mode .port{pointer-events:none;visibility:hidden}@media(max-width:700px){#quickFormat{flex-wrap:wrap;max-width:calc(100% - 24px)}#interactionStatus{bottom:70px;width:calc(100% - 24px);font-size:12px}}
/* Editable connections keep a generous invisible hit area at every zoom level. */
.edge{cursor:pointer}.edge-selection{visibility:hidden}.edge:hover .edge-selection,.edge:focus .edge-selection,.edge-selected .edge-selection{visibility:visible}.edge:focus{outline:none}.edge-label{user-select:none}.connection-target> :first-child{stroke:#294b3c!important;stroke-width:4;filter:drop-shadow(0 0 6px #91b97b)}
#arrowEditor{position:absolute;z-index:7;left:24px;bottom:80px;width:360px;max-width:calc(100% - 48px);padding:16px;background:#fffffc;border:1px solid #cbd8c2;border-radius:14px;box-shadow:0 8px 28px #20372a20;font-size:13px}#arrowEditor .arrow-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:16px}#arrowClose{padding:2px 9px;border:0;font-size:22px;background:transparent}#arrowEditor label{font-size:12px;color:#52664a}#arrowEditor .arrow-label-field{display:grid;gap:5px}#arrowLabel{width:100%;font-size:14px;padding:10px}#arrowEditor .arrow-colors{display:flex;gap:8px;align-items:center;margin:12px 0 4px}#arrowEditor .arrow-colors label{display:flex;align-items:center;gap:6px}#arrowColor{width:30px;height:30px;padding:2px}#arrowColorValue{width:80px;font-size:12px;padding:7px}#arrowDefaultColor{font-size:11px;padding:7px}#arrowColorMode{color:#7b8b73;font-size:11px}#arrowEditor .arrow-actions{display:flex;gap:8px;margin-top:14px}#arrowEditor .arrow-actions button{font-size:12px;padding:9px}#arrowEditor .arrow-actions img{width:18px;height:18px}#arrowFeedback{margin:8px 0 0;color:#98613b;font-size:12px}#arrowFeedback:empty{display:none}.connect-mode .edge,.swap-mode .edge{pointer-events:none}
#arrowEditor .arrow-actions button{flex:1;width:auto;white-space:nowrap}

.text-node:hover .text-box-hit,.text-node:focus .text-box-hit{stroke:#9dad94;stroke-width:1;stroke-dasharray:4 4}.text-node .port:focus,.text-node .port:hover{opacity:1}

.resize-handle[data-corner=nw],.resize-handle[data-corner=se]{cursor:nwse-resize}.resize-handle[data-corner=ne],.resize-handle[data-corner=sw]{cursor:nesw-resize}.resize-handle:focus{outline:none}.resize-handle:hover>rect:last-of-type,.resize-handle:focus>rect:last-of-type{fill:#d5e9c9;stroke:#294b3c;stroke-width:2}.resizing .port{pointer-events:none;visibility:hidden}.resizing{user-select:none}
.workspace:has(.inline-editor) .resize-handle{display:none}
