Here's my code:
html, body {
height: 100%;
margin: 0;
font-family: system-ui, sans-serif;
background: var(--bg);
color: #222;
overflow: hidden;
}
#root, .app {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
}
/* --- Modern Toolbar --- */
.toolbar {
position: fixed;
top: 0; left: 0; right: 0;
z-index: 100;
background: var(--toolbar-bg);
box-shadow: var(--toolbar-shadow);
display: flex;
align-items: center;
gap: 0;
padding: 0 8px;
height: 48px;
min-height: 48px;
font-size: 1em;
user-select: none;
overflow-x: auto;
scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar-btn, .toolbar .file-label, .toolbar .dropdown-btn {
background: none;
border: none;
color: var(--button);
padding: 0 10px;
height: 48px;
min-width: 44px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25em;
cursor: pointer;
transition: background 0.12s, color 0.12s;
border-radius: 0;
position: relative;
}
.toolbar-btn:disabled { color: var(--button-disabled); cursor: not-allowed; }
.toolbar-btn:hover:not(:disabled), .toolbar .file-label:hover, .toolbar .dropdown-btn:hover {
background: #f0f4fa;
color: var(--button-hover);
}
.toolbar .file-label input[type="file"] { display: none; }
.toolbar .dropdown-menu {
position: absolute;
top: 48px; right: 0;
background: var(--toolbar-bg);
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
border-radius: 6px;
min-width: 160px;
z-index: 999;
padding: 6px 0;
display: none;
}
.toolbar .dropdown-btn.open + .dropdown-menu { display: block; }
.toolbar .dropdown-menu button {
width: 100%;
background: none;
border: none;
color: #333;
padding: 10px 18px;
text-align: left;
font-size: 1em;
cursor: pointer;
border-radius: 0;
}
.toolbar .dropdown-menu button:hover { background: #f0f4fa; color: var(--button-hover); }
.toolbar .toolbar-sep {
width: 1px;
height: 28px;
background: #e0e0e0;
margin: 0 4px;
}
.toolbar .toolbar-toggle {
display: flex;
align-items: center;
gap: 2px;
font-size: 1em;
color: #888;
padding: 0 6px;
}
.toolbar .toolbar-toggle input[type="checkbox"] {
accent-color: var(--button);
margin-right: 2px;
}
@media (max-width: 700px) {
.toolbar {
font-size: 1.1em;
height: 52px;
min-height: 52px;
padding: 0 2vw;
overflow-x: auto;
gap: 0;
}
.toolbar-btn, .toolbar .file-label, .toolbar .dropdown-btn {
font-size: 1.3em;
min-width: 44px;
height: 52px;
padding: 0 8px;
}
.toolbar .dropdown-menu {
top: 52px;
right: 0;
min-width: 140px;
}
}
/* --- Main Layout --- /
.main {
flex: 1;
display: flex;
overflow: hidden;
position: relative;
margin-top: 48px; / Space for toolbar */
}
@media (max-width: 700px) {
.main { margin-top: 52px; }
}
/* --- Canvas --- */
.canvas {
flex: 1;
position: relative;
background: var(--canvas-bg);
overflow: hidden;
cursor: grab;
}
.canvas.grabbing { cursor: grabbing; }
.canvas-transform {
position: absolute;
left: 0; top: 0;
will-change: transform;
width: 1px; height: 1px;
z-index: 2;
}
.grid-svg {
position: absolute;
left: 0; top: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 1;
}
.relationship-svg {
position: absolute;
left: 0; top: 0;
width: 100000px; height: 100000px;
pointer-events: none;
z-index: 2;
overflow: visible;
}