:root{color-scheme:light;--font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-mono: "Cascadia Code", "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", monospace;--bg: #f6f7f9;--panel: #ffffff;--ink: #202b3d;--muted: #69727f;--line: #dfe4ec;--line-strong: #c9d1dd;--accent: #315ac6;--accent-hover: #2448a7;--soft: #edf2ff;--gutter: #f9fafc;--error: #a32936;--error-bg: #fff0f1;--warn: #7a5300;--warn-bg: #fff6e0;--ok: #2c7a55;--focus: #315ac6;--selection: #d5e2ff;--active-line: #315ac60a;--run-bg: #236b45;--run-hover: #1b5838;--run-ink: #ffffff;--stop-bg: #a63643;--stop-hover: #8d2b37;--stop-ink: #ffffff;--dot-idle: #9ba8bc;--dot-ready: #4f9d79;--dot-busy: #d39e35;--null: #7a8496;--backdrop: #141a2473;--syntax-keyword: #7048a1;--syntax-number: #73501c;--syntax-name: #235ca5;--syntax-string: #28724e;--syntax-comment: #6b7484;--diagram-paper: #ffffff;--diagram-ink: #111827;--diagram-handle: #eef1f6;--diagram-grid: #d3d9e3;--radius-s: 6px;--radius-m: 8px;--radius-l: 12px;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 32px;--text-xs: 10px;--text-s: 11px;--text-m: 12px;--text-base: 13px}@media (prefers-color-scheme: dark){:root:not([data-theme=light]){color-scheme:dark;--bg: #141a24;--panel: #1c2431;--ink: #e5eaf4;--muted: #a0adc2;--line: #344052;--line-strong: #46546a;--accent: #acc1ff;--accent-hover: #c4d2ff;--soft: #293851;--gutter: #19212d;--error: #ffacb6;--error-bg: #37242c;--warn: #f3cf7a;--warn-bg: #382f1c;--ok: #8fcaa5;--focus: #acc1ff;--selection: #344e78;--active-line: #acc1ff0f;--run-bg: #8fcaa5;--run-hover: #a5dbba;--run-ink: #14271d;--stop-bg: #e9a0a9;--stop-hover: #f2b4bb;--stop-ink: #341b22;--null: #8794a8;--syntax-keyword: #ccb2ef;--syntax-number: #edc78c;--syntax-name: #9fc6ff;--syntax-string: #99d9b1;--syntax-comment: #8d99ad;--diagram-paper: #f8fafc;--diagram-ink: #111827;--diagram-handle: #2a3546;--diagram-grid: #2c3747}}:root[data-theme=dark]{color-scheme:dark;--bg: #141a24;--panel: #1c2431;--ink: #e5eaf4;--muted: #a0adc2;--line: #344052;--line-strong: #46546a;--accent: #acc1ff;--accent-hover: #c4d2ff;--soft: #293851;--gutter: #19212d;--error: #ffacb6;--error-bg: #37242c;--warn: #f3cf7a;--warn-bg: #382f1c;--ok: #8fcaa5;--focus: #acc1ff;--selection: #344e78;--active-line: #acc1ff0f;--run-bg: #8fcaa5;--run-hover: #a5dbba;--run-ink: #14271d;--stop-bg: #e9a0a9;--stop-hover: #f2b4bb;--stop-ink: #341b22;--null: #8794a8;--syntax-keyword: #ccb2ef;--syntax-number: #edc78c;--syntax-name: #9fc6ff;--syntax-string: #99d9b1;--syntax-comment: #8d99ad;--diagram-paper: #f8fafc;--diagram-ink: #111827;--diagram-handle: #2a3546;--diagram-grid: #2c3747}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}body{background:var(--bg);color:var(--ink);font-family:var(--font-sans);font-size:var(--text-base)}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;border:1px solid var(--line);background:var(--panel);border-radius:var(--radius-m);padding:7px 11px;font-weight:600;font-size:var(--text-m);display:inline-flex;align-items:center;gap:6px;white-space:nowrap}button:hover:enabled{background:var(--soft)}button:disabled{opacity:.45;cursor:default}:focus-visible{outline:2px solid var(--focus);outline-offset:2px}kbd{font-family:var(--font-mono);border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:4px;padding:0 5px;font-size:var(--text-s);background:var(--gutter);font-weight:500}input,textarea{border:1px solid var(--line-strong);background:var(--panel);border-radius:var(--radius-s);padding:6px 8px;min-width:0}textarea{resize:vertical;font-size:var(--text-m)}input:focus-visible,textarea:focus-visible{outline:2px solid var(--focus);outline-offset:0;border-color:var(--focus)}.icon{fill:none;stroke:currentColor;stroke-width:1.7px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px;flex-shrink:0}.primary{background:var(--accent);border-color:var(--accent);color:var(--panel)}.primary:hover:enabled{background:var(--accent-hover)}.danger-quiet{color:var(--error)}.danger-quiet:hover:enabled{background:var(--error-bg)}.icon-button{color:var(--muted);background:transparent;border-color:transparent;border-radius:var(--radius-s);padding:4px;display:inline-grid;place-items:center;width:30px;height:30px}.icon-button:hover:enabled{color:var(--ink)}.link-button{background:none;border:0;padding:0;color:var(--accent);text-decoration:underline;text-underline-offset:3px;font-weight:600}.link-button:hover:enabled{background:none;color:var(--accent-hover)}[data-tooltip]{position:relative}[data-tooltip]:after{content:attr(data-tooltip);z-index:10;background:var(--ink);color:var(--panel);white-space:nowrap;pointer-events:none;display:none;border-radius:var(--radius-s);padding:4px 8px;font-size:var(--text-s);font-weight:500;position:absolute;top:calc(100% + 6px);left:50%;transform:translate(-50%)}[data-tooltip]:hover:after,[data-tooltip]:focus-visible:after{display:block}[data-tooltip-pos=end]:after{left:auto;right:0;transform:none}[data-tooltip-pos=above-end]:after{top:auto;bottom:calc(100% + 6px);left:auto;right:0;transform:none}.app{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr)}.app-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 16px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px}.brand-mark{background:var(--ink);color:var(--panel);border-radius:9px;display:grid;place-items:center;width:34px;height:34px;font-size:21px;font-weight:750;letter-spacing:-1px}.brand h1{letter-spacing:-.5px;margin:0;font-size:18px;line-height:1.1}.brand p{color:var(--muted);margin:1px 0 0;font-size:var(--text-s)}.header-actions{display:flex;align-items:center;gap:10px}.save-warning{color:var(--error);font-size:var(--text-s)}.workspace{display:grid;min-height:0;padding:12px 16px 16px}.panel{border:1px solid var(--line);background:var(--panel);border-radius:var(--radius-l);display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.panel-header{border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:var(--space-2);padding:10px 12px 10px 16px}.panel-header h2{margin:0;font-size:var(--text-base);font-weight:600}.panel-subtitle{margin:1px 0 0;color:var(--muted);font-size:var(--text-s)}.splitter{cursor:col-resize;display:grid;place-items:center;touch-action:none;border-radius:var(--radius-s)}.splitter-grip{width:4px;height:40px;border-radius:2px;background:var(--line-strong)}.splitter:hover .splitter-grip,.splitter:focus-visible .splitter-grip{background:var(--accent)}.field-entry{display:flex;gap:6px;padding:10px 12px}.field-entry input{flex:1}.paste-list{display:grid;gap:6px;padding:0 12px 10px;font-size:var(--text-m)}.paste-list label{color:var(--muted)}.paste-list-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px}.sidebar-body{flex:1;min-height:0;overflow:auto;border-top:1px solid var(--line)}.empty-note{color:var(--muted);font-size:var(--text-m);padding:12px 16px;margin:0;line-height:1.5}.field-list{list-style:none;margin:0;padding:6px}.field-row{display:flex;align-items:center;gap:2px;border-radius:var(--radius-s)}.field-row[data-selected]{background:var(--soft)}.field-row.editing{padding:2px}.field-edit{width:100%}.field-toggle{flex:1;min-width:0;min-height:32px;justify-content:flex-start;background:transparent;border:0;border-radius:var(--radius-s);padding:5px 6px;font-weight:400;font-size:var(--text-base);text-align:left;white-space:normal}.field-toggle:hover:enabled{background:var(--soft)}.field-label{overflow-wrap:anywhere}.checkmark{width:16px;height:16px;flex:none;border:1.5px solid var(--line-strong);border-radius:4px;display:grid;place-items:center;background:var(--panel)}.field-row[data-selected] .checkmark{background:var(--accent);border-color:var(--accent);color:var(--panel)}.checkmark .icon{width:12px;height:12px;stroke-width:2.6px}.row-action{width:28px;height:28px}.sidebar-footer{border-top:1px solid var(--line);padding:10px 12px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}.selection-count{color:var(--muted);font-size:var(--text-m)}.place-button{margin-left:auto}.place-button[aria-pressed=true]{box-shadow:inset 0 0 0 2px var(--panel)}.context-bar{display:flex;align-items:center;height:52px;flex:none;padding:0 12px;border-bottom:1px solid var(--line);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}.context-bar:not([data-operation=select]){background:var(--soft)}.diagram-body{flex:1;min-height:0;display:flex}.canvas-area{position:relative;flex:1;min-width:0;display:flex}.tool-strip{display:flex;flex-direction:column;gap:4px;padding:8px 6px;border-right:1px solid var(--line);width:82px;flex:none}.tool{flex-direction:column;gap:3px;border:1px solid transparent;background:transparent;border-radius:var(--radius-m);padding:7px 4px 6px;color:var(--muted);font-size:var(--text-s);white-space:normal;text-align:center;line-height:1.2}.tool .icon{width:18px;height:18px}.tool[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--panel)}.tool[aria-pressed=true]:hover:enabled{background:var(--accent-hover)}.bar-content{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;flex:1;min-width:max-content}.bar-content.operation{min-width:0}.bar-group{display:inline-flex;gap:4px}.icon-text{padding:7px 8px}.flag-button{font-weight:500}.flag-button[aria-pressed=true],.flag-button[aria-pressed=mixed]{border-color:var(--accent);background:var(--soft);font-weight:650}.flag-check{width:14px;height:14px;border:1.5px solid var(--line-strong);border-radius:3px;display:grid;place-items:center}.flag-button[aria-pressed=true] .flag-check,.flag-button[aria-pressed=mixed] .flag-check{background:var(--accent);border-color:var(--accent);color:var(--panel)}.flag-check .icon{width:11px;height:11px;stroke-width:2.6px}.notation-pk{font-weight:750;text-decoration:underline;text-underline-offset:2px}.notation-sample{font-family:var(--font-sans);color:var(--muted);font-weight:500}.op-badge{background:var(--accent);color:var(--panel);border-radius:var(--radius-s);padding:3px 8px;font-weight:700;font-size:var(--text-s);text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}.op-step{text-transform:none;letter-spacing:0;font-weight:500}.instruction{font-weight:500;min-width:220px;flex:1 1 auto;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.bar-content.operation>button{flex:none}.cancel-button{margin-left:auto}.selection-label{margin-right:6px}.hint{color:var(--muted)}.message-slot{position:absolute;top:10px;left:50%;transform:translate(-50%);z-index:6;max-width:calc(100% - 32px);pointer-events:none}.bar-message{display:flex;align-items:center;gap:6px;border-radius:var(--radius-m);padding:4px 4px 4px 12px;font-size:var(--text-m);box-shadow:0 2px 10px #0000001f;pointer-events:auto;border:1px solid var(--line)}.bar-message .icon-button{width:26px;height:26px}.bar-message.error{color:var(--error);background:var(--error-bg);border-color:var(--error)}.bar-message.info{color:var(--ink);background:var(--warn-bg)}.history-actions{display:inline-flex;gap:2px}.header-icon{width:34px;height:34px}.header-icon .icon{width:18px;height:18px}.canvas{position:relative;flex:1;min-height:0;overflow:hidden}.canvas-svg{display:block;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none}.canvas[data-choosing] .canvas-svg,.canvas[data-operation=moveTable] .canvas-svg{cursor:crosshair}.canvas-background{fill-opacity:1}.grid-dot{fill:var(--diagram-grid)}.canvas-empty{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}.canvas-empty p{color:var(--muted);max-width:360px;text-align:center;line-height:1.5;margin:0}.relation-header{cursor:grab}.relation[data-dragging] .relation-header{cursor:grabbing}.relation[data-dragging]{opacity:.85}.header-band{fill:transparent;stroke:none}.relation-header:hover .header-band,.relation[data-selected] .header-band{fill:var(--diagram-handle)}.relation[data-selected] .header-band{stroke:var(--accent);stroke-width:1}.grip{fill:var(--muted)}.relation-name{fill:var(--ink);font-size:13px;font-weight:600;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;cursor:text}.relation-name.placeholder{fill:var(--muted);font-style:italic;font-weight:500}.relation-outline{fill:none;stroke:var(--accent);stroke-width:1.5;stroke-dasharray:5 3;pointer-events:none}.cell{cursor:pointer}.cell-box{fill:var(--diagram-paper);stroke:var(--diagram-ink);stroke-width:1.25}.cell:hover .cell-box{fill:#f1f5ff}.attr-text{fill:var(--diagram-ink);font-size:15px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;pointer-events:none}.attr-underline{stroke:var(--diagram-ink);stroke-width:1.3;pointer-events:none}.cell[data-selected] .cell-box{fill:#e3ebff}.cell-selection{fill:none;stroke:#315ac6;stroke-width:3;pointer-events:none}.cell-tick{fill:#315ac6;pointer-events:none}.cell[data-dragged]{opacity:.4}.add-cell{cursor:pointer}.add-cell rect{fill:transparent;stroke:var(--line-strong);stroke-dasharray:3 3}.add-cell path{stroke:var(--muted);stroke-width:1.7;stroke-linecap:round}.add-cell:hover rect{fill:var(--soft);stroke:var(--accent)}.relation[data-destination] .cell-box{stroke-dasharray:none}.relation[data-destination]:hover .cell-box{fill:#e3ebff}.relation[data-destination]:hover .header-band{fill:var(--diagram-handle);stroke:var(--accent)}.relation:focus-within .header-band{fill:var(--diagram-handle)}.relation-header:focus-visible,.cell:focus-visible,.add-cell:focus-visible{outline:none}.relation-header:focus-visible .header-band,.cell:focus-visible .cell-box,.add-cell:focus-visible rect{stroke:var(--focus);stroke-width:2.5}.preview{pointer-events:none}.preview-bar{stroke:var(--accent);stroke-width:3.5;stroke-linecap:round}.preview-caret{fill:var(--accent)}.preview-table{fill:var(--soft);fill-opacity:.7;stroke:var(--accent);stroke-width:1.5;stroke-dasharray:5 3}.preview-label{fill:var(--accent);font-size:12px;font-weight:650;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.drag-ghost{position:fixed;z-index:50;pointer-events:none;background:var(--ink);color:var(--panel);border-radius:var(--radius-s);padding:4px 8px;font-size:var(--text-s);font-weight:600;box-shadow:0 4px 12px #00000030}.field-toggle{user-select:none;-webkit-user-select:none}.canvas-input{position:absolute;padding:0 6px;border-radius:4px;border:2px solid var(--focus);background:var(--panel);z-index:5}.zoom-controls{position:absolute;right:12px;bottom:12px;display:flex;align-items:center;gap:2px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-m);padding:3px;box-shadow:0 2px 8px #00000014}.zoom-level{border:0;background:transparent;font-variant-numeric:tabular-nums;min-width:52px;justify-content:center;padding:6px}.help-dialog{border:1px solid var(--line);border-radius:var(--radius-l);background:var(--panel);color:var(--ink);padding:0;width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 64px)}.help-dialog::backdrop{background:var(--backdrop)}.dialog-header{display:flex;justify-content:space-between;align-items:center;padding:12px 12px 12px 20px;border-bottom:1px solid var(--line)}.dialog-header h2{margin:0;font-size:15px}.dialog-body{padding:4px 20px 16px;line-height:1.55}.dialog-body h3{font-size:var(--text-base);margin:14px 0 4px}.dialog-body ul{margin:0;padding-left:18px}.dialog-body p{margin:0}@media (max-width: 720px){.workspace{grid-template-columns:1fr!important;grid-template-rows:minmax(180px,38%) minmax(0,1fr);gap:10px;padding:10px 16px 16px}.splitter,.brand p{display:none}}.notation-table{border-collapse:collapse;margin:2px 0 4px}.notation-table td{padding:3px 14px 3px 0;vertical-align:baseline}.notation-table td:first-child{font-size:15px;white-space:nowrap}
