* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #0f172a;
    /* Slate 900 */
    color: #e2e8f0;
    /* Slate 200 */
}

#app {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 250px;
    background-color: #1e293b;
    /* Slate 800 */
    border-right: 1px solid #334155;
    /* Slate 700 */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h2,
h3 {
    color: #f8fafc;
    /* Slate 50 */
    margin-bottom: 0.5rem;
}

.mode-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #0f172a;
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #2563eb;
    color: white;
    font-weight: bold;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-btn {
    padding: 0.75rem 1rem;
    text-align: left;
    background-color: #334155;
    /* Slate 700 */
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #475569;
    /* Slate 600 */
}

.tool-btn.active {
    background-color: #2563eb;
    /* Blue 600 */
    border-color: #60a5fa;
    /* Blue 400 */
}

.tool-btn.danger {
    background-color: #7f1d1d;
    /* Red 900 */
    color: #fca5a5;
    /* Red 300 */
    margin-top: 0.5rem;
}

.tool-btn.danger:hover {
    background-color: #b91c1c;
    /* Red 700 */
    color: white;
}

.action-btn {
    padding: 0.75rem 1rem;
    text-align: left;
    background-color: #334155;
    /* Slate 700 */
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background-color: #475569;
    /* Slate 600 */
}

.info-panel {
    margin-top: auto;
    font-size: 0.875rem;
    color: #94a3b8;
    /* Slate 400 */
}

.info-panel ul {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.info-panel li {
    margin-bottom: 0.25rem;
}

main {
    flex: 1;
    position: relative;
    background-color: #0f172a;
    /* Slate 900 */
    cursor: crosshair;
}

canvas {
    display: block;
}

/* Fullscreen Run Mode */
#app.run-mode #sidebar {
    position: absolute;
    width: auto;
    background: transparent;
    border: none;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    padding: 10px;
    z-index: 100;
    left: 0;
    top: 0;
}

#app.run-mode .file-controls,
#app.run-mode .mode-switch {
    pointer-events: auto;
    /* Enable clicks on buttons */
    background: #1e293b;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    display: flex;
    gap: 5px;
}

#app.run-mode .file-controls {
    margin-bottom: 5px;
}

#app.run-mode #toolbar-header,
#app.run-mode #edit-tools,
#app.run-mode #selection-tools,
#app.run-mode #run-tools,
#app.run-mode #info-panel {
    display: none !important;
}