:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:block;min-width:320px;min-height:100svh;min-height:100dvh;background:transparent}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}:root{--bg: #f6f8f9;--panel: #ffffff;--ink: #1f2937;--muted: #6b7280;--primary: #356854;--primary-ink: #ffffff;--border: #e5e7eb;--accent: #e8eaed}*{box-sizing:border-box}html,body,#root{height:100%;overscroll-behavior-y:none}html{height:-webkit-fill-available}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg)}body{display:block;place-items:normal;min-height:100%;height:100%;overflow:hidden}#root{width:100%;height:100%}.app{height:100vh;height:100svh;height:100dvh;contain:layout paint;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:env(safe-area-inset-bottom)}body.modal-open,body.modal-open .app{overflow:hidden}.app-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--panel);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100}.brand{display:flex;align-items:center;gap:10px}.brand h1{font-size:18px;margin:0}.logo-circle{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--primary);color:var(--primary-ink)}.logo-img{width:36px;height:36px;border-radius:6px;object-fit:cover}.actions{display:flex;gap:8px}.hamburger{display:none;background:transparent;border:1px solid var(--border);border-radius:8px;padding:6px 10px}.mobile-menu{display:none;position:absolute;right:12px;top:58px;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:8px;min-width:180px;box-shadow:0 8px 24px #00000014;z-index:2000}.mobile-menu a,.mobile-menu button{display:block;width:100%;text-align:left;padding:8px 10px;border-radius:8px;border:1px solid transparent;background:transparent;color:var(--ink);cursor:pointer}.mobile-menu a:hover,.mobile-menu button:hover{background:var(--accent);border-color:var(--border)}.btn{padding:8px 12px;border:1px solid var(--border);background:var(--panel);border-radius:8px;cursor:pointer;color:var(--ink)}.btn:hover{background:#f3f4f6}.btn.primary{background:var(--primary);color:var(--primary-ink);border-color:transparent}.btn.primary:hover{filter:brightness(1.05)}.icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 6px;min-width:0;height:24px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--muted);cursor:pointer;font-size:12px;line-height:1}.icon-btn:hover{background:var(--accent);color:var(--ink);border-color:var(--border)}.icon-btn.add,.icon-btn.edit,.icon-btn.delete{color:var(--muted)}.icon-btn.delete:hover{color:#b91c1c}.layout{display:grid;grid-template-columns:1fr;gap:12px;padding:12px;width:100%;max-width:none;margin:0}.layout.two-col{grid-template-columns:280px 1fr;align-items:start}.layout.three-col{grid-template-columns:minmax(290px,320px) minmax(600px,1fr) minmax(420px,1.05fr);align-items:start;grid-template-areas:"sidebar canvas graph"}.sidebar,.graph-sidebar{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:12px;color:var(--ink)}.sidebar{grid-area:sidebar}.canvas{grid-area:canvas}.graph-sidebar{grid-area:graph}.palette{display:grid;gap:8px}.palette-header{display:flex;align-items:center;justify-content:space-between}.palette-header h2{font-size:16px;margin:0}.palette-search input{width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:8px}.palette-search input{color:var(--ink);background:var(--panel)}.palette-list{display:grid;gap:6px;max-height:calc(100svh - 220px);max-height:calc(100dvh - 220px);overflow:auto}.palette-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--border);background:var(--panel);border-radius:8px;cursor:pointer;text-align:left;color:var(--ink);appearance:none;-webkit-appearance:none}.palette-item:hover{background:#fafafa}.palette-item:focus-visible{outline:2px solid #94a3b8;outline-offset:2px}.palette-item-name{flex:1 1 auto;min-width:0;color:var(--ink)}.palette-item .badge{margin-left:auto}.canvas{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:12px;position:relative;min-width:0}.legend{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.legend .legend-item{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}.legend .swatch{width:12px;height:12px;border-radius:3px;border:1px solid var(--border)}.legend-header{display:flex;align-items:center;justify-content:space-between;margin:4px 0 8px}.legend-header h2{font-size:16px;margin:0}.tree-wrapper{position:relative;overflow-anchor:none}.overlay-svg{position:absolute;inset:0;pointer-events:none;width:100%;height:100%}.tree{list-style:none;margin:0;padding-left:0;position:relative}.tree-node{margin:4px 0}.node-row{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border:1px solid var(--border);border-radius:8px;background:var(--panel);box-shadow:0 1px #00000005;flex-wrap:nowrap}.node-row:hover{background:#fafafa}.node-row.tree-hover{outline:2px solid #94a3b8;box-shadow:0 0 0 3px #94a3b859 inset}.drag-handle{cursor:grab;color:var(--muted);touch-action:none;-webkit-user-select:none;user-select:none}.node-row{-webkit-user-select:none;user-select:none}.tree-wrapper{overscroll-behavior:contain}.node-label{font-weight:600;flex:1 1 auto;min-width:0}.node-badges{display:flex;gap:6px;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-left:auto;flex:0 0 auto;width:max-content}.node-badges .badge{display:inline-flex;align-items:center;justify-content:center;min-width:110px}.node-row.badges-vertical{align-items:flex-start}.node-row.badges-vertical .node-badges{flex-direction:column;align-items:flex-end;width:auto}.node-row.badges-vertical .node-badges .badge{min-width:0;width:max-content}.node-row.badges-hidden .node-badges{display:none}.badge{display:inline-block;font-size:11px;padding:2px 6px;border-radius:999px;background:var(--accent);color:var(--ink);border:1px solid var(--border);text-align:center;line-height:1.2;word-break:break-word}.badge.type{background:#eef2ff;border-color:#c7d2fe}.badge.warning{background:#fef3c7;border-color:#fde68a}.children{list-style:none;margin:4px 0 4px 20px;padding-left:14px;border-left:2px solid #e5e7eb}.modal-backdrop{position:fixed;inset:0;width:100vw;height:100vh;height:100svh;height:100dvh;background:#0003;display:grid;place-items:center;overflow:hidden;padding:12px;z-index:1000}.modal{border:1px solid var(--border);border-radius:12px;padding:0;width:min(520px,90vw);max-width:90vw;max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);background:var(--panel);display:flex;flex-direction:column;overflow:hidden}.modal header{padding:12px;border-bottom:1px solid var(--border)}.modal header h3{margin:3px}.modal .form{padding:12px;overflow:auto;-webkit-overflow-scrolling:touch;flex:1 1 auto;min-height:0}.field{display:grid;gap:6px;margin-bottom:10px}input[type=text],select{padding:8px 10px;border:1px solid var(--border);border-radius:8px}.dialog-actions{display:flex;gap:8px;justify-content:flex-end;padding:8px 12px;border-top:1px solid var(--border)}@media (max-width: 480px){.modal{width:90vw;max-width:90vw;max-height:100svh;max-height:100dvh;border-radius:12px}}@media (min-width: 768px){.modal-backdrop{align-items:center;padding:24px}.modal{max-height:calc(100svh - 48px);max-height:calc(100dvh - 48px)}}.dropzone{background:transparent;transition:background .1s ease,opacity .1s ease;pointer-events:auto}.dropzone.over{opacity:.7;height:10px}.tree-pane{min-width:0}.graph-pane{min-width:300px}.graph-pane .graph-box{display:grid;place-items:center;min-height:200px;background:#fafafa;border:1px dashed var(--border);border-radius:8px;color:var(--muted)}.graph-pane img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:8px;background:#fff}.graph-pane .svg-wrapper{overflow:auto;border:1px solid var(--border);border-radius:8px;background:#fff;max-height:calc(100svh - 260px);max-height:calc(100dvh - 260px)}.graph-meta{margin-top:8px}.graph-meta details{font-size:12px;color:var(--muted)}@media (min-width: 1024px){.graph-sidebar{height:90svh;display:flex;flex-direction:column}.graph-pane{display:flex;flex-direction:column;height:100%}.graph-pane .graph-viewport{flex:1 1 auto;display:flex}.graph-pane .svg-wrapper{flex:1 1 auto;max-height:none}}.editor-initial-loader{display:grid;place-items:center;min-height:120px;background:#fafafa;border:1px dashed var(--border);border-radius:8px;color:var(--muted)}.page{width:100%;max-width:1200px;margin:16px auto;padding:0 16px}.page-header{display:flex;align-items:center;justify-content:space-between;margin:8px 0 12px}.page-header h2{margin:0;font-size:22px}.card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px}.toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:12px}.toolbar .field{margin:0}.table-responsive{width:100%;overflow:auto;border-radius:10px;border:1px solid var(--border)}.data-table{width:100%;border-collapse:separate;border-spacing:0}.data-table thead th{position:sticky;top:0;background:#f8fafc;color:#111827;text-align:left;font-weight:600;padding:10px 12px;border-bottom:1px solid var(--border)}.data-table tbody td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:middle}.data-table tbody tr:hover{background:#fafafa}.data-table td.actions{text-align:right;display:flex;justify-content:flex-end;align-items:center;gap:8px}.btn-group{display:inline-flex;gap:8px}.global-loader{position:fixed;right:16px;bottom:16px;display:inline-flex;align-items:center;gap:10px;background:#fffffff5;border:1px solid var(--border);box-shadow:0 8px 24px #00000014;padding:8px 12px;border-radius:999px;z-index:3000}.global-loader .label{color:var(--muted);font-size:12px}.spinner{width:16px;height:16px;border-radius:50%;border:2px solid #cbd5e1;border-top-color:var(--primary);animation:spin .9s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 640px){.page{padding:0 10px}.toolbar{gap:8px;flex-direction:column;align-items:stretch}.toolbar .field{width:100%}.page-header{flex-direction:column;align-items:stretch;gap:8px}.page-header .btn{align-self:flex-end}.table-responsive{border:none}.data-table{display:block}.data-table thead{display:none}.data-table tbody{display:grid;gap:10px}.data-table tbody tr{display:block;border:1px solid var(--border);border-radius:10px;background:var(--panel)}.data-table tbody td{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border)}.data-table tbody td:last-child{border-bottom:none}.data-table tbody td:before{content:attr(data-col);font-weight:600;color:var(--muted);margin-right:12px}.data-table td.actions{justify-content:space-between}.data-table td.actions .btn-group{margin-left:auto;display:inline-flex;gap:8px}}@media (max-width: 1480px){.layout.three-col{grid-template-columns:minmax(200px,260px) 1fr minmax(300px,1fr);grid-template-areas:"sidebar canvas graph"}}@media (max-width: 1480px){.layout.three-col{grid-template-columns:1fr minmax(300px,1fr);grid-template-areas:"canvas graph"}.sidebar{display:none}}@media (max-width: 1024px){.layout.three-col{grid-template-columns:1fr;grid-template-areas:"graph" "canvas"}.app-header{position:static;top:auto}.app-header.header-hidden{transform:none}.drag-handle,.actions{display:none}.hamburger{display:inline-flex}}@media (hover: none),(pointer: coarse),(max-width: 768px){.layout.three-col{grid-template-columns:1fr;grid-template-areas:"graph" "canvas"}.graph-pane{margin-top:12px}}
