/* ─── Bottom Toolbar ─── */
#bottomBar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(10, 10, 30, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 20;
    display: flex;
    flex-direction: column;
    color: #e0e0e0;
}
#bottomBarInner {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 6px;
    overflow-x: auto;
}
#bottomBarInner::-webkit-scrollbar { height: 0; }


/* Palette items in bottom toolbar */
.palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 6px;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    cursor: pointer;
    font-size: 8px;
    font-weight: 500;
    background: rgba(255,255,255,0.03);
    color: #999;
    transition: all 0.15s;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex: none;
    min-width: 42px;
}
.palette-item:hover { background: rgba(74, 158, 255, 0.1); border-color: rgba(74, 158, 255, 0.3); color: #ccc; }
.palette-item.selected { background: rgba(74, 158, 255, 0.2); border-color: #4a9eff; color: #fff; box-shadow: 0 0 8px rgba(74, 158, 255, 0.3); }
.palette-item svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.palette-item.selected svg { stroke: #4a9eff; }
.palette-item.tool { border-color: rgba(255, 100, 100, 0.15); }
.palette-item.tool:hover { background: rgba(255, 74, 74, 0.1); border-color: rgba(255, 74, 74, 0.3); }
.palette-item.tool.selected { background: rgba(255, 74, 74, 0.2); border-color: #ff4a4a; color: #ff4a4a; box-shadow: 0 0 8px rgba(255, 74, 74, 0.3); }

.bar-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    flex: none;
    margin: 0 2px;
}

.bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 8px;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    cursor: pointer;
    font-size: 8px;
    font-weight: 500;
    background: rgba(255,255,255,0.03);
    color: #999;
    transition: all 0.15s;
    white-space: nowrap;
    flex: none;
}
.bar-btn:hover { background: rgba(255,255,255,0.08); color: #ccc; border-color: rgba(255,255,255,0.15); }
.bar-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bar-btn.active { background: rgba(74,158,255,0.15); color: #4a9eff; border-color: rgba(74,158,255,0.3); }
.bar-btn.bar-btn-primary { background: rgba(74,158,255,0.15); color: #4a9eff; border-color: rgba(74,158,255,0.3); }
.bar-btn.bar-btn-primary:hover { background: rgba(74,158,255,0.25); }
.bar-btn.bar-btn-danger { background: rgba(255,74,74,0.12); color: #ff6b6b; border-color: rgba(255,74,74,0.25); }
.bar-btn.bar-btn-danger:hover { background: rgba(255,74,74,0.2); }

.btn-row { display: flex; gap: 6px; margin-top: 6px; }

button {
    flex: 1;
    padding: 9px 6px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.btn-primary { background: #4a9eff; color: #fff; }
.btn-primary:hover { background: #3a8eef; transform: translateY(-1px); }
.btn-danger { background: #ff4a4a; color: #fff; }
.btn-danger:hover { background: #ef3a3a; }
.btn-warning { background: #ff9f1a; color: #fff; }
.btn-warning:hover { background: #e88f0a; }
.btn-secondary { background: rgba(255,255,255,0.08); color: #ccc; }
.btn-secondary:hover { background: rgba(255,255,255,0.15); color: #fff; }
