/* ─────────────────────────────────────────
   CSS CUSTOM PROPERTIES  (design tokens)
───────────────────────────────────────── */
:root {
    --surface-variant:           #353534;
    --surface-container:         #201f1f;
    --on-surface:                #e5e2e1;
    --surface-container-low:     #1c1b1b;
    --background:                #131313;
    --outline:                   #a4899d;
    --outline-variant:           #564052;
    --primary-container:         #ff00ff;
    --surface-container-highest: #353534;
    --surface-container-lowest:  #0e0e0e;
    --surface-container-high:    #2a2a2a;

    --color-fuchsia-300: #e879f9;
    --color-fuchsia-400: #e040fb;
    --color-fuchsia-500: #d946ef;
    --color-fuchsia-900: #4a044e;
    --color-cyan-400:    #22d3ee;
    --color-cyan-500:    #06b6d4;
    --color-cyan-600:    #0891b2;
    --color-cyan-900:    #164e63;
    --color-red-400:     #f87171;
    --color-red-500:     #ef4444;
    --color-red-900:     #7f1d1d;

    /* Layer sidebar width */
    --layer-sidebar-w: 200px;
}

/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--background);
    color: var(--on-surface);
    font-family: 'Manrope', sans-serif;
    overflow: hidden;
    margin: 0;
}
body::selection       { background-color: var(--primary-container); color: white; }
body::-moz-selection  { background-color: var(--primary-container); color: white; }

.hidden { display: none !important; }

/* ─────────────────────────────────────────
   HEADER / TOP NAV
───────────────────────────────────────── */
header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 56px;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
    background: linear-gradient(to right, #131313, #1a1a1a, #131313);
    border-bottom: 2px solid rgba(112, 26, 117, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

div.navGroup {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    color: var(--color-fuchsia-500);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
    cursor: default;
    user-select: none;
}

.topNav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.zoomControls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoomBtn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: rgba(217, 70, 239, 0.5);
    display: flex;
    align-items: center;
    transition: color 0.1s;
}
.zoomBtn:hover { color: var(--color-fuchsia-300); }
.zoomBtn .material-symbols-outlined { font-size: 16px; }

#zoomDisplay {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    color: var(--color-fuchsia-400);
    width: 48px;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.navBtn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: rgba(224, 64, 251, 0.7);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.1s;
}
.navBtn:hover { color: var(--color-fuchsia-300); }
.navBtn .material-symbols-outlined { font-size: 16px; }

.sizeLabel {
    font-size: 12px;
    color: rgba(224, 64, 251, 0.7);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sizeSelect {
    background-color: var(--surface-container);
    border: 1px solid var(--outline-variant);
    color: var(--color-fuchsia-300);
    padding: 4px;
    font-size: 12px;
    outline: none;
    border-radius: 0;
    z-index: 50;
    cursor: pointer;
}
.sizeSelect:focus { border-color: var(--color-fuchsia-500); }

/* ─────────────────────────────────────────
   APP LAYOUT
───────────────────────────────────────── */
.appLayout {
    display: flex;
    height: 100dvh;
    padding-top: 56px;
    padding-bottom: 64px;
}

/* ─────────────────────────────────────────
   LEFT SIDEBAR (Toolbox)
───────────────────────────────────────── */
.sidebarLeft {
    position: fixed;
    left: 0;
    top: 56px;
    height: calc(100vh - 120px);
    width: 80px;
    z-index: 40;
    background-color: #0e0e0e;
    border-right: 2px solid rgba(22, 78, 99, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.toolbarHeader {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.toolbarTitle {
    font-family: 'Manrope', sans-serif;
    font-size: 8px;
    letter-spacing: 0.2em;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(8, 145, 178, 0.5);
}

.toolButton {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 8px 0;
    align-items: center;
    background-color: transparent;
    border: none;
    gap: 4px;
    color: rgba(6, 182, 212, 0.4);
    cursor: pointer;
    transition-property: none;
}
.toolButton:hover { background-color: rgba(8, 51, 68, 0.3); }
.toolButton .material-symbols-outlined { font-size: 32px; }

.toolLabel {
    font-family: 'Manrope', sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.active-tool {
    background-color: rgba(34, 211, 238, 0.2) !important;
    color: #22d3ee !important;
    box-shadow: inset 0 0 10px rgba(34, 211, 238, 0.2);
    transition: 0.1s;
}

.toolBarSpacer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 16px 8px 0;
    gap: 8px;
    border-top: 1px solid rgba(22, 78, 99, 0.2);
}

.gridToggleLabel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding-bottom: 8px;
}

.gridToggleBox {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(6, 182, 212, 0.05);
    position: relative;
    color: var(--color-cyan-400);
}
.gridToggleLabel:hover .gridToggleBox { background-color: rgba(6, 182, 212, 0.2); }
.gridToggleBox .material-symbols-outlined { font-size: 32px; }

.gridToggleInput {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.btnClearFrame {
    width: 100%;
    background-color: rgba(127, 29, 29, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--color-red-500);
    padding: 8px 0;
    font-size: 32px;
    text-transform: uppercase;
    cursor: pointer;
}
.btnClearFrame:hover { background-color: rgba(127, 29, 29, 0.5); }

.btnContour { position: relative; }

/* ─────────────────────────────────────────
   MAIN CANVAS WORKSPACE
───────────────────────────────────────── */
main {
    flex: 1;
    display: flex;
    position: relative;
    margin-left: 80px;
    margin-right: calc(288px + var(--layer-sidebar-w));
    padding: 0;
    height: 100%;
    background-color: #0e0e0e;
}

#viewport {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    overflow: hidden;
    outline: none;
    background-color: var(--surface-container-low);
}

.backgroundCanvas {
    background-image: url('assets/canvasbg.png');
    background-repeat: repeat;
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    z-index: 2;
    image-rendering: pixelated;
}

.onionCanvas {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
    mix-blend-mode: screen;
    image-rendering: pixelated;
}

.paintCanvas {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    z-index: 3;
    image-rendering: pixelated;
}

/* Layers below the active layer — rendered under paintCanvas */
.layersBelowCanvas {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
    image-rendering: pixelated;
}

/* Layers above the active layer — rendered over paintCanvas but under grid */
.layersAboveCanvas {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 4;
    image-rendering: pixelated;
}

.gridCanvas {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
    image-rendering: pixelated;
}

canvas { image-rendering: pixelated; }

#canvasContainer {
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--surface-container-highest);
}

.cornerBracket {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--color-fuchsia-900);
    border-style: solid;
    pointer-events: none;
    z-index: 10;
}
.cornerBracket--tl { top: 32px; left: 32px;    border-width: 2px 0 0 2px; }
.cornerBracket--tr { top: 32px; right: 32px;   border-width: 2px 2px 0 0; }
.cornerBracket--bl { bottom: 32px; left: 32px;  border-width: 0 0 2px 2px; }
.cornerBracket--br { bottom: 32px; right: 32px; border-width: 0 2px 2px 0; }

/* ─────────────────────────────────────────
   RIGHT SIDEBAR — Colors & Palettes
───────────────────────────────────────── */
.sidebarRight {
    position: fixed;
    right: var(--layer-sidebar-w);
    top: 56px;
    height: calc(100vh - 120px);
    width: 288px;
    z-index: 40;
    background-color: var(--surface-container-lowest);
    border-left: 2px solid rgba(86, 64, 82, 0.2);
    display: flex;
    flex-direction: column;
    padding: 5px;
    overflow: hidden;
}

.previewSection {
    display: flex;
    justify-content: center;
    margin-bottom: 1px;
    margin-top: 1px;
    position: relative;
}

.previewGlow {
    position: absolute;
    inset: -4px;
    background-color: var(--primary-container);
    opacity: 0.1;
    filter: blur(20px);
    transition: opacity 0.2s;
}
.previewSection:hover .previewGlow { opacity: 0.2; }

.previewFrame {
    border: 1px solid var(--outline-variant);
    border-color: rgba(74, 4, 78, 0.3);
    padding: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    background-color: var(--surface-container);
    position: relative;
}

.previewCanvas {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    mix-blend-mode: screen;
}

.fpsSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(250, 232, 255, 0.05);
    padding: 5px 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.fpsSectionLabel {
    color: rgba(224, 64, 251, 0.7);
    letter-spacing: 0.3em;
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.fpsControls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpsIcon {
    color: rgba(224, 64, 251, 0.7);
    font-size: 16px;
}

.fpsInput {
    width: 48px;
    text-align: center;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 20px;
    color: var(--color-fuchsia-400);
    font-family: monospace;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
}
.fpsInput::-webkit-outer-spin-button,
.fpsInput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.fpsUnit {
    color: rgba(224, 64, 251, 0.7);
    font-weight: 700;
    font-size: 10px;
}

.colorWheelSection {
    display: flex;
    flex-direction: column;
    align-items: center;
}

h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--on-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 5px;
    border-top: 1px solid rgba(86, 64, 82, 0.2);
}

#colorWheelContainer {
    display: flex;
    justify-content: center;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.palettesPanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.palettePickerRow {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    text-align: center;
}

.palettePickerSwatch {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 0;
    border: 1px solid var(--outline-variant);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.paletteColorDisplay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-color: #007bff;
}

#btnAddPaletteRow {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
    line-height: 16px;
    padding: 7px 8px;
    border: 1px solid var(--outline-variant);
    flex: 1;
    cursor: pointer;
    background-color: var(--surface-container);
    color: var(--outline);
    margin: 0;
}
#btnAddPaletteRow:hover { border-color: rgba(224, 64, 251, 0.7); }

.paletteRows {
    flex: 1;
    overflow-y: auto;
    display: block;
    padding-right: 8px;
}

.palette-row {
    display: flex;
    gap: 2px;
    margin-bottom: 2px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.color-swatch:hover { border-color: #fff; }

.configContainer {
    margin-top: 16px;
    border-top: 1px solid rgba(86, 64, 82, 0.2);
    padding-top: 16px;
    color: var(--outline);
}

.configLabel {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--outline);
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}
.configLabel:hover { color: white; }

#chkOnion {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--outline-variant);
    background-color: var(--surface-container);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}
#chkOnion:checked { background-color: var(--color-fuchsia-500); border-color: var(--color-fuchsia-500); }
#chkOnion:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 11px;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
}
#chkOnion:focus { outline: none; box-shadow: 0 0 0 2px rgba(217, 70, 239, 0.5); }

input[type="color"].invisible-color {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ─────────────────────────────────────────
   RIGHT SIDEBAR 2 — Layers
───────────────────────────────────────── */
.sidebarLayers {
    position: fixed;
    right: 0;
    top: 56px;
    height: calc(100vh - 120px);
    width: var(--layer-sidebar-w);
    z-index: 41;
    background-color: #0b0b0b;
    border-left: 2px solid rgba(34, 211, 238, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Panel header */
.layerPanelHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 6px;
    border-bottom: 1px solid rgba(34, 211, 238, 0.12);
    flex-shrink: 0;
}

.layerPanelTitle {
    font-family: 'Manrope', sans-serif;
    font-size: 9px;
    letter-spacing: 0.22em;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(34, 211, 238, 0.5);
}

.layerHeaderActions {
    display: flex;
    gap: 2px;
}

.layerIconBtn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: rgba(34, 211, 238, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: color 0.1s, background 0.1s;
}
.layerIconBtn:hover {
    color: var(--color-cyan-400);
    background-color: rgba(34, 211, 238, 0.1);
}
.layerIconBtn .material-symbols-outlined { font-size: 16px; }

/* Layer list scroll area */
.layerList {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}
.layerList::-webkit-scrollbar { width: 4px; }
.layerList::-webkit-scrollbar-track { background: transparent; }
.layerList::-webkit-scrollbar-thumb { background-color: rgba(34, 211, 238, 0.2); border-radius: 2px; }

/* Individual layer row */
.layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s, border-color 0.1s;
    user-select: none;
    min-height: 44px;
}
.layer-item:hover {
    background-color: rgba(34, 211, 238, 0.05);
}
.layer-active {
    background-color: rgba(34, 211, 238, 0.1) !important;
    border-left-color: var(--color-cyan-400) !important;
}

/* Thumbnail */
.layer-thumb {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    image-rendering: pixelated;
    border: 1px solid rgba(255,255,255,0.08);
    background-color: rgba(255,255,255,0.04);
    background-image:
        linear-gradient(45deg, #333 25%, transparent 25%),
        linear-gradient(-45deg, #333 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #333 75%),
        linear-gradient(-45deg, transparent 75%, #333 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    border-radius: 1px;
}

/* Eye / visibility button */
.layer-eye {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: rgba(34, 211, 238, 0.5);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.1s;
}
.layer-eye:hover { color: var(--color-cyan-400); }
.layer-eye--hidden { color: rgba(255,255,255,0.15) !important; }
.layer-eye .material-symbols-outlined { font-size: 14px; }

/* Layer name (editable) */
.layer-name {
    flex: 1;
    font-size: 11px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    color: var(--on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    outline: none;
    border-radius: 2px;
    padding: 1px 2px;
    min-width: 0;
}
.layer-name:focus {
    background-color: rgba(34, 211, 238, 0.1);
    color: #fff;
    text-overflow: clip;
    overflow: visible;
}

/* ─── Opacity row ───────────────────────────────────────────────────────── */
.layerOpacityRow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
    flex-shrink: 0;
}

.layerOpacityLabel {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(34, 211, 238, 0.45);
    flex-shrink: 0;
    width: 42px;
}

.layerOpacitySlider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: rgba(34, 211, 238, 0.2);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
}
.layerOpacitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-cyan-400);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.6);
}
.layerOpacitySlider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-cyan-400);
    border: none;
    cursor: pointer;
}

.layerOpacityValue {
    font-family: monospace;
    font-size: 10px;
    color: var(--color-cyan-400);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

/* ─── Layer action buttons ──────────────────────────────────────────────── */
.layerActions {
    display: flex;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
    flex-shrink: 0;
}

.layerActionBtn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 9px;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.12s, color 0.12s;
}
.layerActionBtn .material-symbols-outlined { font-size: 16px; }

.layerActionBtn--add {
    color: rgba(34, 211, 238, 0.5);
    border-right: 1px solid rgba(34, 211, 238, 0.1);
}
.layerActionBtn--add:hover { background-color: rgba(34, 211, 238, 0.12); color: var(--color-cyan-400); }

.layerActionBtn--dup {
    color: rgba(217, 70, 239, 0.45);
    border-right: 1px solid rgba(34, 211, 238, 0.1);
}
.layerActionBtn--dup:hover { background-color: rgba(217, 70, 239, 0.1); color: var(--color-fuchsia-300); }

.layerActionBtn--del {
    color: rgba(239, 68, 68, 0.4);
}
.layerActionBtn--del:hover { background-color: rgba(239, 68, 68, 0.1); color: var(--color-red-400); }

.layerActionLabel {
    font-size: 8px;
}

/* ─────────────────────────────────────────
   FOOTER / ANIMATION TIMELINE
───────────────────────────────────────── */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 64px;
    z-index: 50;
    background-color: #131313;
    border-top: 2px solid rgba(74, 4, 78, 0.3);
    box-shadow: 0 -4px 20px rgba(255, 0, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    overflow: hidden;
    user-select: none;
}

.frameNavGroup {
    display: flex;
    align-items: center;
    gap: 16px;
}

.frameNavBtn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: rgba(217, 70, 239, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    outline: none;
    transition: color 0.1s;
}
.frameNavBtn:hover { color: var(--color-fuchsia-300); }
.frameNavBtn .material-symbols-outlined { font-size: 20px; }

#frameIndicator {
    font-family: monospace;
    color: var(--color-fuchsia-400);
    font-size: 12px;
    text-align: center;
    width: 150px;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.frameActionsGroup {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid rgba(74, 4, 78, 0.2);
    border-right: 1px solid rgba(74, 4, 78, 0.2);
    padding: 12px 24px;
    height: 100%;
}

.btnAddFrame,
.btnDuplicateFrame,
.btnDeleteFrame {
    height: 100%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: color 0.15s, border-color 0.15s;
}

.btnAddFrame {
    padding: 0 20px;
    border: 1px dashed rgba(217, 70, 239, 0.4);
    background: transparent;
    color: rgba(217, 70, 239, 0.5);
    gap: 8px;
}
.btnAddFrame:hover { color: var(--color-fuchsia-400); border-color: var(--color-fuchsia-500); }
.btnAddFrame .material-symbols-outlined { font-size: 18px; }

.btnDuplicateFrame {
    padding: 0 16px;
    border: 1px solid rgba(217, 70, 239, 0.2);
    background-color: var(--surface-container-low);
    color: rgba(217, 70, 239, 0.4);
}
.btnDuplicateFrame:hover { color: var(--color-fuchsia-400); border-color: var(--color-fuchsia-500); }
.btnDuplicateFrame .material-symbols-outlined { font-size: 16px; }

.btnDeleteFrame {
    padding: 0 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background-color: var(--surface-container-highest);
    color: rgba(239, 68, 68, 0.4);
}
.btnDeleteFrame:hover { color: var(--color-red-400); border-color: var(--color-red-500); }
.btnDeleteFrame .material-symbols-outlined { font-size: 16px; }

.footerSpacer { flex: 1; }

/* ─────────────────────────────────────────
   MISC / UTILITIES
───────────────────────────────────────── */
.pan-tool-active { cursor: grab !important; }
.canvas-container { position: relative; }

/* ─────────────────────────────────────────
   COLLAPSIBLE COLOR WHEEL
───────────────────────────────────────── */
.collapsible-heading {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.collapsible-heading:hover { color: var(--color-fuchsia-300); }

.collapseChevron {
    font-size: 16px;
    color: rgba(224, 64, 251, 0.5);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.colorWheelBody {
    overflow: hidden;
    max-height: 300px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}
.colorWheelBody.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
