:root{--bg-main: #020617;--bg-sidebar: #0f172a;--bg-card: #1e293b;--bg-input: #020617;--border: #334155;--border-focus: #f59e0b;--text-main: #f8fafc;--text-muted: #94a3b8;--text-dim: #64748b;--amber: #f59e0b;--amber-hover: #fbbf24;--emerald: #10b981;--red: #ef4444}*{box-sizing:border-box;margin:0;padding:0}body{background-color:var(--bg-main);color:var(--text-main);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}header{height:52px;background:#0f172af2;border-bottom:1px solid var(--border);padding:0 16px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.brand-icon{width:30px;height:30px;border-radius:6px;background:linear-gradient(135deg,#fbbf24,#d97706);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#0f172a;box-shadow:0 2px 8px #f59e0b40}.brand-badge{font-size:11px;font-weight:600;padding:2px 8px;border-radius:9999px;background:#f59e0b1f;color:var(--amber);border:1px solid rgba(245,158,11,.25);margin-left:8px}.site-nav{display:flex;gap:2px;margin-left:14px;padding-left:14px;border-left:1px solid var(--border)}.site-nav a{padding:4px 10px;border-radius:6px;font-size:12px;font-weight:600;color:var(--text-muted);text-decoration:none;transition:background .15s,color .15s}.site-nav a:hover{background:var(--bg-card);color:var(--text-main)}.site-nav a[aria-current=page]{background:var(--bg-card);color:var(--amber)}.privacy-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:6px;background:#1e293bcc;border:1px solid rgba(51,65,85,.6);font-size:11px;color:var(--text-muted)}.pulse-dot{width:7px;height:7px;border-radius:50%;background:var(--emerald);box-shadow:0 0 8px var(--emerald)}main{flex:1;display:flex;overflow:hidden}.sidebar{width:420px;min-width:360px;max-width:500px;background:var(--bg-sidebar);border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0}.controls-panel{padding:12px;border-bottom:1px solid var(--border);display:flex;flex-direction:column;gap:10px;background:#0f172ad9}.control-row{display:flex;align-items:center;gap:8px}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.control-field{display:flex;flex-direction:column;gap:3px;min-width:0}.field-note{margin:0;font-size:10px;line-height:1.45;overflow-wrap:anywhere}.field-note.is-error{color:#f87171}.field-note.is-warning{color:#fbbf24}.control-hint{margin:6px 0 0;font-size:10.5px;line-height:1.55;color:var(--text-dim)}.control-hint code{padding:0 3px;border-radius:3px;background:var(--bg-card);color:var(--text-muted);font-size:10.5px}.ring-swatch{display:inline-block;width:7px;height:7px;margin-right:3px;border-radius:2px;vertical-align:baseline}.ring-swatch.ring-1{background:#ef6c00}.ring-swatch.ring-2{background:#00796b}.ring-swatch.ring-3{background:#6a1b9a}label.label-txt{font-size:11px;font-weight:600;color:var(--text-muted);width:52px;flex-shrink:0}select,input[type=text]{flex:1;background:var(--bg-card);border:1px solid var(--border);border-radius:5px;padding:5px 8px;font-size:12px;color:var(--text-main);outline:none;transition:border-color .15s}select:focus,input[type=text]:focus{border-color:var(--border-focus)}input[type=text].has-error,input[type=text].has-error:focus{border-color:#f87171}input[type=text].has-warning,input[type=text].has-warning:focus{border-color:#fbbf24}.btn-primary{padding:6px 14px;border-radius:6px;background:var(--amber);color:#0f172a;font-weight:700;font-size:12px;border:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:background .15s,transform .05s;box-shadow:0 2px 8px #f59e0b40}.btn-primary:hover{background:var(--amber-hover)}.btn-primary:active{transform:scale(.98)}.btn-primary:disabled{opacity:.6;cursor:not-allowed}.editor-panel{flex:1;display:flex;flex-direction:column;padding:12px;overflow:hidden}.editor-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;font-size:11px;font-weight:600;color:var(--text-muted)}.btn-clear{background:none;border:none;color:var(--text-dim);cursor:pointer;font-size:11px;transition:color .15s}.btn-clear:hover{color:var(--red)}textarea#sqlEditor{flex:1;width:100%;background:var(--bg-input);border:1px solid var(--border);border-radius:6px;padding:10px;font-family:Fira Code,Menlo,Monaco,Consolas,monospace;font-size:11.5px;line-height:1.5;color:var(--text-main);resize:none;outline:none;tab-size:2;transition:border-color .15s}textarea#sqlEditor:focus{border-color:#64748b}.status-bar{height:32px;border-top:1px solid var(--border);background:#0f172af2;padding:0 12px;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-muted)}.status-bar .text-emerald-400{color:#34d399}.status-bar .text-amber-400{color:#fbbf24}.status-bar .text-red-400{color:#f87171}.status-bar .text-slate-400{color:var(--text-muted)}.viewport-section{flex:1;position:relative;background:var(--bg-main);overflow:hidden;display:flex;flex-direction:column}.canvas-toolbar{position:absolute;top:14px;right:14px;z-index:20;display:flex;align-items:center;gap:4px;background:#0f172aeb;border:1px solid var(--border);border-radius:8px;padding:4px 6px;box-shadow:0 8px 24px #0006;backdrop-filter:blur(8px)}.tool-btn{background:none;border:none;color:var(--text-muted);border-radius:5px;padding:4px 6px;font-size:11px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}.tool-btn:hover{background:var(--bg-card);color:var(--text-main)}.tool-btn-accent{background:var(--amber);color:#0f172a;font-weight:700;padding:4px 8px}.tool-btn-accent:hover{background:var(--amber-hover);color:#0f172a}.toolbar-divider{width:1px;height:14px;background:var(--border);margin:0 3px}#canvasViewport{flex:1;width:100%;height:100%;cursor:grab;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background-image:radial-gradient(rgba(148,163,184,.12) 1px,transparent 1px);background-size:24px 24px}#canvasViewport:active{cursor:grabbing}#canvasTransform{transform-origin:center center;user-select:none}#svgContainer{box-shadow:0 20px 50px #00000080;border-radius:8px;overflow:hidden;border:1px solid var(--border);background:#fff}#svgContainer svg{display:block;max-width:none}#svgContainer g:hover>rect[stroke]{stroke:#f59e0b;cursor:pointer}#canvasViewport[data-tool=select] .erd-table{cursor:grab;touch-action:none}#canvasViewport[data-tool=pan] .erd-table{cursor:inherit}.erd-table.is-dragging{cursor:grabbing}#svgContainer svg.has-highlight .erd-edge{opacity:.18}#svgContainer svg.has-highlight .erd-edge.is-related{opacity:1}.tool-btn[aria-pressed=true]{background:var(--bg-card);color:var(--amber)}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:#0f172a99}::-webkit-scrollbar-thumb{background:#334155cc;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#64748b}#siteFooter{position:fixed;right:12px;bottom:8px;display:flex;gap:14px;align-items:center;font-size:11px;color:var(--text-muted, #94a3b8);background:#0f172ab8;padding:5px 12px;border-radius:6px;border:1px solid var(--border, #334155);z-index:20;pointer-events:none}#siteFooter a{color:var(--text-muted, #94a3b8);text-decoration:none;pointer-events:auto}#siteFooter a:hover{color:var(--amber, #f59e0b);text-decoration:underline}.mobile-tabs{display:none;flex-shrink:0;gap:6px;padding:6px 8px;background:var(--bg-sidebar);border-bottom:1px solid var(--border)}.mobile-tab{flex:1;padding:8px 12px;border:1px solid var(--border);border-radius:6px;background:var(--bg-card);color:var(--text-muted);font-size:13px;font-weight:600;cursor:pointer;transition:background .15s,color .15s}.mobile-tab[aria-selected=true]{background:var(--amber);color:#0f172a;border-color:var(--amber)}@media(max-width:820px){.mobile-tabs{display:flex}main{flex-direction:column;min-height:0}.sidebar{width:100%;min-width:0;max-width:none;border-right:none;flex:1;min-height:0}.viewport-section{width:100%}.control-grid{grid-template-columns:1fr}.viewport-section{display:none}body[data-mobile-view=diagram] .viewport-section{display:flex}body[data-mobile-view=diagram] .sidebar{display:none}select,input[type=text],textarea#sqlEditor{font-size:16px}#siteFooter{position:static;width:100%;justify-content:center;border-radius:0;border:none;border-top:1px solid var(--border);background:var(--bg-sidebar)}.canvas-toolbar{top:8px;right:8px}}@media(max-width:560px){.privacy-badge{display:none}}
