:root{--navy:#172b3a;--navy-2:#203b4d;--blue:#2877a7;--blue-hover:#1f638d;--line:#d8e0e6;--muted:#6b7b87;--surface:#fff;--bg:#edf1f4;--danger:#b94b4b;--text:#243746}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:Arial,Helvetica,sans-serif;color:var(--text);font-size:13px;background:var(--bg)}button,input,textarea{font:inherit}.app-header{height:62px;background:var(--navy);color:#f5f8fa;display:flex;align-items:center;padding:0 22px;gap:12px;border-bottom:3px solid #2d87b5}.brand-mark{width:32px;height:32px;border-radius:5px;background:#eaf3f8;color:var(--navy);font-weight:800;font-size:20px;display:grid;place-items:center}.brand-copy{display:flex;flex-direction:column;gap:3px}.brand-copy strong{font-size:16px;letter-spacing:.1px}.brand-copy strong span{font-weight:400;color:#9ec5dc}.brand-copy small{font-size:11px;color:#b4c3cc}.header-right{margin-left:auto;display:flex;align-items:center;gap:8px;color:#c5d2da;font-size:11px}.status-dot{width:7px;height:7px;border-radius:50%;background:#7fc7a3;display:inline-block}.header-divider{height:18px;border-left:1px solid #49606f;margin:0 7px}.kbd,kbd{font-family:Arial,sans-serif;font-size:10px;color:#c6d5de;border:1px solid #526674;border-radius:3px;padding:4px 6px}
#toolbar{min-height:83px;background:#fff;border-bottom:1px solid #cbd5dc;display:flex;align-items:stretch;gap:0;padding:9px 14px;overflow-x:auto;box-shadow:0 2px 4px #1b2c3910;position:relative;z-index:2}.tool-group{display:flex;align-items:center;align-content:center;gap:5px;flex-wrap:wrap;padding:0 12px;min-width:max-content;position:relative}.tool-group:first-child{padding-left:2px}.group-label{position:absolute;top:-2px;left:13px;font-size:9px;font-weight:700;letter-spacing:1px;color:#7a8a95}.tool-group{padding-top:13px}.toolbar-separator{width:1px;background:#e1e7eb;margin:6px 3px}.tool-button{height:31px;padding:0 10px;background:#f8fafb;border:1px solid #cbd6de;border-radius:3px;color:#334b5a;cursor:pointer;white-space:nowrap;transition:background .12s,border-color .12s}.tool-button:hover{background:#edf4f8;border-color:#9fb7c6}.tool-button.primary{background:var(--blue);border-color:var(--blue);color:white;font-weight:600}.tool-button.primary:hover{background:var(--blue-hover)}.tool-button.compact{min-width:31px;padding:0 8px;font-size:16px}.tool-button.danger-quiet{color:#9b4848}.tool-button.danger-quiet:hover{background:#fff0f0;border-color:#dfb6b6}.tool-button.active{background:#e0f0f8;border-color:#438ab0;color:#14567c;box-shadow:inset 0 0 0 1px #438ab0}
.workspace{height:calc(100% - 145px);display:flex;min-height:0;min-width:0}.canvas-area{display:flex;flex:1;min-width:0;flex-direction:column;background:#f5f7f8}.canvas-topline{height:39px;flex:none;background:#fff;border-bottom:1px solid #e0e6ea;display:flex;align-items:center;justify-content:space-between;padding:0 16px;color:#334b5a}.canvas-topline strong{font-size:12px}.canvas-subtitle{font-size:11px;color:#82909a}.canvas-hints{display:flex;gap:16px;font-size:10px;color:#7b8a94}.canvas-hints span{display:flex;align-items:center;gap:5px}.hint-square{width:10px;height:8px;border:1px solid #879ba8;background:white}.hint-dash{width:15px;border-top:1px dashed #879ba8}.canvas-wrap{flex:1;min-height:0;min-width:0;position:relative;overflow:auto;background-color:#f6f8fa;background-image:linear-gradient(#dce3e8 1px,transparent 1px),linear-gradient(90deg,#dce3e8 1px,transparent 1px);background-size:20px 20px}#canvas{display:block;width:3200px;height:2200px;max-width:none;max-height:none;background:transparent;touch-action:none;flex:none}.uml rect{fill:#fff;stroke:#526a79;stroke-width:1.3}.uml text{fill:#263f4e;user-select:none}.uml-group{pointer-events:all}.uml-group rect{pointer-events:visibleStroke;fill:#eaf1f5;fill-opacity:.28;stroke:#8ba2b0;stroke-width:1.2;stroke-dasharray:6 4}.uml-group text{fill:#486474;user-select:none}.uml.selected rect:first-child{stroke:#e68a35;stroke-width:2.5}.uml-group.selected rect:first-child{stroke:#e68a35;stroke-width:2;stroke-dasharray:5 3}.edge{cursor:pointer;pointer-events:stroke}.edge text{pointer-events:all}.active{background:#d8edf8!important;border-color:#3684ad!important;color:#165578!important}.statusbar{height:27px;flex:none;background:#e8edf0;border-top:1px solid #d1dbe1;display:flex;align-items:center;justify-content:space-between;padding:0 12px;font-size:10px;color:#627582}.status-right{display:flex;align-items:center;gap:10px}.status-divider{height:12px;border-left:1px solid #c3cfd6}
.inspector{width:255px;flex:none;background:#fff;border-left:1px solid #ccd6dd;display:flex;flex-direction:column;min-height:0}.inspector-heading{height:58px;padding:0 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e2e8ec}.inspector-icon{width:28px;height:28px;border:1px solid #d2dfe6;background:#f3f7f9;border-radius:4px;display:grid;place-items:center;color:#39708d;font-size:17px}.inspector-heading strong{display:block;font-size:12px}.inspector-heading small{display:block;color:#82909a;font-size:10px;margin-top:4px}.inspector-empty{padding:32px 20px;text-align:center;color:#7b8a94}.empty-icon{font-size:29px;color:#9eb2bf;margin-bottom:12px}.inspector-empty strong{display:block;color:#4b606d;font-size:12px}.inspector-empty p{font-size:11px;line-height:1.6}.inspector-fields{padding:16px 14px}.inspector-fields label{display:block;font-size:10px;font-weight:700;color:#617784;margin:0 0 6px}.inspector-fields input,.inspector-fields textarea{width:100%;border:1px solid #cbd6dd;border-radius:3px;padding:8px;background:#fbfcfd;color:#263f4e;margin-bottom:14px;outline:none;resize:vertical}.inspector-fields input:focus,.inspector-fields textarea:focus{border-color:#4b95bb;box-shadow:0 0 0 2px #4b95bb22}.inspector-note{font-size:10px;color:#7d8e98;border-top:1px solid #e6ecef;padding-top:11px}.inspector-bottom{margin-top:auto;border-top:1px solid #e0e7eb;padding:13px 14px;background:#fafcfd}.shortcut-row{display:flex;justify-content:space-between;gap:5px;align-items:center;margin:7px 0;font-size:10px;color:#7b8a94}.shortcut-row kbd{color:#627784;border-color:#d3dde3;background:#fff;white-space:nowrap;font-size:9px;padding:3px 4px}
@media(max-width:1050px){.project-sidebar{width:190px}.inspector{width:220px}.header-right{display:none}.tool-group{padding-left:8px;padding-right:8px}.canvas-hints{display:none}}@media(max-width:720px){.project-sidebar{width:155px}.inspector{width:190px}.brand-copy small{display:none}.app-header{padding:0 12px}#toolbar{min-height:78px}.workspace{height:calc(100% - 140px)}}

/* Project tree and expansive, scrollable drawing surface */
.project-sidebar{width:230px;flex:0 0 230px;min-width:150px;display:flex;flex-direction:column;min-height:0;background:#f9fbfc;border-right:1px solid #cbd5dc;color:#334b5a}
.sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:13px 10px 8px;border-bottom:1px solid #e0e7eb;font-size:9px;font-weight:700;letter-spacing:.7px;color:#71838e}
.sidebar-heading button{border:1px solid #cbd6de;background:#fff;border-radius:3px;padding:5px 6px;font-size:10px;color:#38576a;cursor:pointer;white-space:nowrap}
.project-actions{padding:10px;border-bottom:1px solid #e0e7eb}.project-actions .tool-button{width:100%}
.project-tree{padding:8px 6px;overflow:auto;flex:1;min-height:0}
.tree-folder{margin:2px 0}.tree-folder-head,.tree-file{display:flex;align-items:center;gap:7px;padding:8px 7px;border-radius:3px;cursor:pointer;min-width:0;color:#405a69}
.tree-folder-head{font-weight:700;font-size:11px}.tree-folder-head:hover,.tree-file:hover{background:#eaf1f5}.tree-folder-head .folder-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-children{padding-left:13px}.tree-file{font-size:11px;line-height:1.3}.tree-file .file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.tree-file.active{background:#dcecf5!important;border:1px solid #b7d3e2!important;color:#174f70!important}.tree-file-icon{color:#3981a5;font-size:13px}.tree-mini-action{border:0;background:transparent;color:#708590;padding:2px 4px;cursor:pointer;border-radius:3px}.tree-mini-action:hover{background:#dce6eb;color:#243f4f}.sidebar-footer{padding:10px;border-top:1px solid #e0e7eb;font-size:9px;color:#7a8b95;line-height:1.5}.local-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#60a783;margin-right:5px}
.canvas-wrap{overscroll-behavior:contain}.canvas-wrap::-webkit-scrollbar,.project-tree::-webkit-scrollbar{width:10px;height:10px}.canvas-wrap::-webkit-scrollbar-thumb,.project-tree::-webkit-scrollbar-thumb{background:#c6d1d8;border:2px solid #f4f7f9;border-radius:8px}
/* Clear, always-visible project tree actions */
.tree-mini-action{flex:0 0 auto;min-width:20px;min-height:22px;font-size:12px;line-height:1;padding:3px 4px;opacity:.85}
.tree-folder-head .tree-mini-action,.tree-file .tree-mini-action{visibility:visible}
.tree-delete-action{color:#a94b4b}
.tree-delete-action:hover{background:#fdeaea!important;color:#a12626!important}
.tree-folder-head .folder-name,.tree-file .file-name{min-width:0}


/* High-contrast selection and connection-mode feedback */
.uml.selected rect:first-child, .uml-group.selected rect:first-child { stroke: #d58a42 !important; stroke-width: 2.5px !important; filter: none !important; }
.uml-group.selected rect:first-child { stroke-dasharray: 5 3; }
.connect-source rect:first-child { stroke: #087fc1 !important; stroke-width: 4px !important; filter: drop-shadow(0 0 4px #087fc180); }
#canvas.connect-mode { cursor: crosshair; }
#connect.active { background: #d8f4e8 !important; border-color: #159765 !important; color: #075f3e !important; box-shadow: inset 0 0 0 1px #159765, 0 0 0 2px #15976522; font-weight: 700; }
.edge { stroke-linecap: round; }
.edge:not(text):hover { stroke: #2877a7; stroke-width: 2.2px; }

/* Group containers must not block objects placed inside them. Only the group border is a hit target; children remain interactive. */
.uml-group > rect:first-child{pointer-events:visibleStroke;}
.uml-group > text{pointer-events:visiblePainted;cursor:move;}
.uml-group > rect:last-child{pointer-events:all;}




/* Restrained, single-colour brand treatment. The editor's existing palette and layout remain unchanged. */
.brand-mark{background:var(--navy)!important;color:#f5f8fa!important;border:1px solid #49606f!important;border-radius:7px!important;box-shadow:none!important}
.brand-mark svg{width:25px;height:25px}
.brand-copy strong{font-size:17px;letter-spacing:-.2px;color:#f5f8fa!important;font-weight:700}
.brand-copy strong span,.brand-copy strong em{color:inherit!important;font-style:normal;font-weight:700}
.brand-copy small{color:#b4c3cc!important;letter-spacing:.1px}

/* Softer Adminer-like palette with subtly hand-drawn architecture shapes */
.uml rect { stroke-linejoin: round; stroke-linecap: round; stroke-width: 1.35; filter: none; }
.uml text { font-family: "Trebuchet MS", Arial, sans-serif; }
.uml-group rect { fill: #e8edf0; fill-opacity: .22; stroke: #98a7af; stroke-dasharray: 5 4; }
.edge:not(text) { stroke: #586a73 !important; stroke-width: 1.5 !important; }
.edge.edge-label { fill: #465b67 !important; stroke: none !important; stroke-width: 0 !important; font-size: 11px; font-family: Arial, sans-serif; paint-order: normal; }
.edge.edge-label:hover { stroke: none !important; stroke-width: 0 !important; }

/* Project-wide search and alignment controls */
.project-search { padding: 12px 14px; border-bottom: 1px solid var(--border, #d9e0e8); display: grid; gap: 7px; }
.project-search label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #68778a); }
.project-search input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--border, #d9e0e8); border-radius: 7px; padding: 9px 10px; background: var(--panel, #fff); color: inherit; font: inherit; }
.project-search-results { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.project-search-result { display: grid; gap: 2px; text-align: left; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; padding: 7px 8px; cursor: pointer; min-width: 0; }
.project-search-result:hover, .project-search-result:focus-visible { border-color: var(--accent, #3b82f6); background: var(--hover, #f2f7fc); outline: none; }
.project-search-result strong { font-size: 12px; overflow-wrap: anywhere; }
.project-search-result small, .project-search-empty { font-size: 11px; color: var(--muted, #68778a); overflow-wrap: anywhere; }
