/* ============================================
   Anima Studio Pro - Unified Stylesheet
   Merged from: styles-base.css, styles-tools.css, styles-features.css
   ============================================ */

/* ============================================
   Anima Studio Pro v3.1 - Refined Dark Theme
   Clean, consistent, drag-friendly
   ============================================ */

/* === PERFORMANCE OPTIMIZATIONS === */

/* === DRAG AND DROP LAYER MANAGEMENT === */
.layer-item.layer-dragging {
    opacity: 0.4;
}
.layer-item.layer-drop-above {
    border-top: 2px solid var(--accent) !important;
    margin-top: -1px;
}
.layer-item.layer-drop-below {
    border-bottom: 2px solid var(--accent) !important;
    margin-bottom: -1px;
}
.layer-item.layer-drop-into {
    background: rgba(99, 102, 241, 0.12) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 4px;
}
.layer-item[draggable="true"] {
    cursor: grab;
}
.layer-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Plugin notification animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* GPU-accelerated layers - ONLY for truly animated elements */
.playhead-line {
    will-change: left;
    transform: translateZ(0);
}

/* Optimize scrolling performance */
.layer-list, .timeline-scroll-area, .panel {
    -webkit-overflow-scrolling: touch;
}

/* Reduce paint areas */
.viewport, .timeline-panel {
    contain: layout style paint;
}

/* Optimize font rendering */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
}

/* Reduce layout thrashing in timeline */
.frames-track, .tracks-wrapper {
    contain: layout;
}

/* Smooth transitions only when needed */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Icon Size Control (Global) --- */
[data-lucide] svg,
i svg,
.btn-toolbar svg,
.tool-btn svg,
.header svg,
.group-header svg,
.group-content svg {
    width: 14px;
    height: 14px;
}
.tool-btn svg {
    width: 16px;
    height: 16px;
}
.btn-icon svg {
    width: 14px;
    height: 14px;
}
.header .logo + div ~ .btn-toolbar svg {
    width: 13px;
    height: 13px;
}

/* --- 1. Variables & Reset --- */
:root {
    color-scheme: dark;
    --bg-dark:      #0f1115;
    --bg-panel:     #16191e;
    --bg-panel-alt: rgba(30, 34, 42, 0.7);
    --bg-hover:     #2a2f3a;
    --bg-active:    #323846;
    --bg-input:     #0a0c10;
    --accent:       #818cf8;
    --accent-hover: #6366f1;
    --accent-dim:   rgba(129, 140, 248, 0.1);
    --selected:     #312e81;
    --text-main:    #e2e8f0;
    --text-dim:     #94a3b8;
    --text-bright:  #ffffff;
    --border:       #262b35;
    --border-light: #334155;
    --danger: #f43f5e;
    --success: #10b981;
    --audio-bg: hsl(38, 80%, 50%);
    --media-bg: #ec4899;
    --folder-bg: #3b82f6;
    --timeline-h: 350px;
    --tween-color: #0ea5e9;
    --range-color: rgba(16, 185, 129, 0.15);
    --mask-color: #a855f7;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 12px;
    touch-action: none;
    font-weight: 600;
}

/* --- 2. Layout & Panels --- */
.header {
    height: 42px;
    background: var(--bg-panel-alt);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 10px;
    justify-content: space-between;
    z-index: 100;
    flex: none;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.header::-webkit-scrollbar { height: 0px; }

.header-left, .header-right {
    display: flex;
    gap: 6px;
    align-items: center;
}
.logo {
    font-weight: 800;
    color: var(--accent);
    font-size: 13px;
    margin-left: 8px;
    display: inline-block;
    letter-spacing: 0.5px;
}

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.panel {
    width: 280px;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 50;
    border-inline-start: 1px solid var(--border);
    border-inline-end: 1px solid var(--border);
}

/* CRITICAL FIX: Remove transition from panels to fix drag lag */
/* .panel { transition: none; } -- no transition on panels */

@media (max-width: 600px) {
    .panel { width: 220px; }
    .logo { font-size: 11px; margin-left: 5px; }
}

.panel::-webkit-scrollbar { width: 5px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: #3a3d46; border-radius: 3px; }
.panel::-webkit-scrollbar-thumb:hover { background: #4a4d56; }

.viewport {
    flex: 1;
    position: relative;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-width: 0;
    touch-action: none;
}
canvas {
    display: block;
    outline: none;
    touch-action: none;
}

/* --- 3. UI Components --- */
.group-header {
    padding: 10px 12px;
    background: var(--bg-panel-alt);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-bright);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.group-header:hover {
    background: var(--bg-hover);
    color: #ffffff;
}
.group-content {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    display: none;
    background: transparent;
}
.group-content.open { display: block; }

.btn-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: #ffffff;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.btn-toolbar:hover {
    background: var(--bg-hover);
    border-color: #555555;
}
.btn-toolbar.active {
    background: var(--selected);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
}
.btn-danger {
    color: var(--danger);
    border-color: var(--border);
}
.btn-danger:hover {
    background: rgba(229, 72, 77, 0.08);
    border-color: var(--danger);
}
.btn-bake {
    background: var(--tween-color);
    border-color: var(--tween-color);
    color: #fff;
    font-weight: 600;
}
.btn-bake:hover {
    background: #38bdf8;
}
.btn-icon {
    width: 26px;
    height: 26px;
    padding: 0;
    justify-content: center;
}
.export-btn {
    background: rgba(48, 164, 108, 0.12);
    border-color: var(--success);
    color: var(--success);
}
.export-btn:hover {
    background: rgba(48, 164, 108, 0.2);
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.col-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

label {
    color: #cccccc;
    min-width: 60px;
    font-size: 11px;
    font-weight: 600;
}
input[type="text"], input[type="number"], select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #ffffff;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    flex: 1;
    width: 100%;
    outline: none;
    font-size: 11px;
    font-weight: 600;
    transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--accent);
    background: #222222;
}
input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: var(--accent);
    height: 18px;
}
input[type="color"] {
    width: 28px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    background: transparent;
}
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 1px);
}
input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 1px);
}

/* Compact professional dark color picker popover */
.anp-cp-popover {
    position: fixed;
    z-index: 200000;
    width: 210px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, #151a23 0%, #10141b 100%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
    color: #eef3ff;
    display: none;
    user-select: none;
}
.anp-cp-popover.is-open {
    display: block;
}
.anp-cp-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.anp-cp-preview {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}
.anp-cp-hex {
    flex: 1;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    background: #0d1118;
    color: #f3f6ff;
    font-size: 11px;
    font-weight: 700;
    padding: 0 8px;
    outline: none;
}
.anp-cp-copy {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1a2230;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.anp-cp-copy:hover {
    background: #202b3d;
}
.anp-cp-copy-icon-svg {
    width: 14px;
    height: 14px;
    fill: #edf3ff;
    display: block;
}
.anp-cp-copy.is-done {
    border-color: rgba(76, 175, 80, 0.7);
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.35) inset;
}
.anp-cp-copy.is-error {
    border-color: rgba(235, 87, 87, 0.7);
    box-shadow: 0 0 0 1px rgba(235, 87, 87, 0.35) inset;
}
.anp-eyedropper-active,
.anp-eyedropper-active * {
    cursor: crosshair !important;
}
.anp-cp-sv-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    overflow: hidden;
    cursor: crosshair;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.anp-cp-sv-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0));
}
.anp-cp-sv-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000000, rgba(0, 0, 0, 0));
}
.anp-cp-sv-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.anp-cp-hue {
    width: 100%;
    margin-top: 8px;
    direction: ltr;
    height: 14px;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(
        90deg,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.18);
    outline: none;
    cursor: pointer;
}
.anp-cp-hue::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 999px;
    background: transparent;
}
.anp-cp-hue::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
    margin-top: -1px;
}
.anp-cp-hue::-moz-range-track {
    height: 14px;
    border-radius: 999px;
    background: transparent;
}
.anp-cp-hue::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
}
.custom-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    max-height: 140px;
    overflow-y: auto;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    margin: 6px 10px 0 10px;
    background: var(--bg-dark);
}
.custom-tools-grid::-webkit-scrollbar { width: 5px; }
.custom-tools-grid::-webkit-scrollbar-thumb { background: #3a3d46; border-radius: 3px; }

.tool-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tool-btn:hover {
    background: #2a2a2a;
    border-color: var(--accent);
}
.tool-btn.active {
    background: rgba(99,102,241,0.15);
    border-color: var(--accent);
    color: #ffffff;
}
/* Ø¥Ø¨Ø±Ø§Ø² Ø®Ø§Øµ Ù„Ø£Ø¯Ø§Ø© Ø§Ù„ØªØ­Ø±ÙŠÙƒ Ù„ØªÙƒÙˆÙ† Ø£ÙˆØ¶Ø­ Ù„Ù„Ù…Ø³ØªØ®Ø¯Ù… */
#toolMove {
    border-color: var(--accent);
    color: var(--accent);
}
#toolMove.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.45);
}
.tool-separator {
    grid-column: span 4;
    height: 1px;
    background: var(--border);
    margin: 3px 0;
}

/* --- 4. Layer List & Folders --- */
.layer-list {
    /* Ø§Ø±ØªÙØ§Ø¹ Ù‚Ø§Ø¨Ù„ Ù„Ù„ØªØ®ØµÙŠØµ Ø¹Ø¨Ø± Ø§Ù„Ù…ØªØºÙŠØ± --layer-list-height.
       Ø§Ù„Ø´Ø±ÙŠØ· Ø§Ù„Ù…ÙˆØ¬ÙˆØ¯ Ø£Ø³ÙÙ„ Ø§Ù„Ù„ÙˆØ­Ø© ÙŠÙ‚ÙˆÙ… Ø¨ØªØ­Ø¯ÙŠØ« Ù‡Ø°Ø§ Ø§Ù„Ù…ØªØºÙŠØ±. */
    height: var(--layer-list-height, 250px);
    max-height: 70vh;
    min-height: 120px;
    overflow-y: auto;
    background: transparent;
    border-bottom: 1px solid var(--border);
    resize: none;
}

/* Ø´Ø±ÙŠØ· ØµØºÙŠØ± Ø£Ø³ÙÙ„ Ù‚Ø§Ø¦Ù…Ø© Ø§Ù„Ø·Ø¨Ù‚Ø§Øª ÙˆØ§Ù„ÙˆØ³Ø§Ø¦Ø· ÙŠÙØ³ØªØ®Ø¯Ù… Ù„ØªÙ…Ø¯ÙŠØ¯ Ø§Ù„Ø§Ø±ØªÙØ§Ø¹ */
.layers-resize-handle {
    height: 6px;
    cursor: ns-resize;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 100%
    );
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 3px;
    margin-top: 6px;
    position: relative;
    transition: background 0.15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.layers-resize-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 2px;
    background: rgba(255,255,255,0.28);
    border-radius: 2px;
    box-shadow: 0 3px 0 rgba(255,255,255,0.16);
}
.layers-resize-handle:hover {
    background: linear-gradient(
        to bottom,
        rgba(59,130,246,0.10) 0%,
        rgba(59,130,246,0.28) 50%,
        rgba(59,130,246,0.10) 100%
    );
}
.layers-resize-handle.active {
    background: linear-gradient(
        to bottom,
        rgba(59,130,246,0.15) 0%,
        rgba(59,130,246,0.45) 50%,
        rgba(59,130,246,0.15) 100%
    );
}
body.layers-resizing,
body.layers-resizing * {
    cursor: ns-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.layer-list::-webkit-scrollbar { width: 5px; }
.layer-list::-webkit-scrollbar-track { background: transparent; }
.layer-list::-webkit-scrollbar-thumb { background: #3a3d46; border-radius: 3px; }

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    position: relative;
    transition: background 0.1s;
}
.layer-item:hover {
    background: var(--bg-hover);
}
.layer-item.active {
    background: var(--bg-active);
    border-right: 3px solid var(--accent);
}
.layer-item.selected {
    background: rgba(99, 102, 241, 0.18) !important;
    border-right: 3px solid rgba(99, 102, 241, 0.5);
}
.layer-item.selected.active {
    background: rgba(99, 102, 241, 0.25) !important;
    border-right: 3px solid var(--accent);
}
.layer-item.media-item {
    border-left: 2px solid var(--media-bg);
}

.layer-item.folder-item {
    background: var(--bg-panel-alt);
    border-left: 3px solid var(--folder-bg);
}
.layer-item.folder-item.selected {
    background: rgba(59, 130, 246, 0.18) !important;
    border-right: 3px solid rgba(59, 130, 246, 0.5);
}
.layer-item.folder-item.active,
.layer-item.folder-item.selected.active {
    background: rgba(59, 130, 246, 0.25) !important;
    border-right: 3px solid var(--accent);
}
/* FIX v249: Persistent highlight for the active drawing page / layer,
   visible across all frames so the user always knows where strokes go. */
.layer-item.active-draw-page {
    background: rgba(34, 197, 94, 0.22) !important;
    border-right: 3px solid #22c55e !important;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}
.layer-item.active-draw-page::after {
    content: "âœ";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #22c55e;
    pointer-events: none;
    opacity: 0.9;
}
.layer-item.active-draw-layer.folder-item {
    border-left: 3px solid #22c55e !important;
    background: rgba(34, 197, 94, 0.10) !important;
}
.layer-item.active-draw-layer.folder-item.selected {
    background: rgba(34, 197, 94, 0.22) !important;
}
.layer-indent { display: inline-block; width: 0; }
.folder-toggle {
    cursor: pointer;
    width: 15px;
    text-align: center;
    color: var(--text-dim);
    font-size: 10px;
}
.folder-toggle:hover { color: var(--text-bright); }
.drag-over-folder {
    border: 2px dashed var(--accent) !important;
    background: var(--accent-dim) !important;
}
.root-drop-zone {
    height: 32px;
    margin: 5px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 10px;
    cursor: default;
    transition: background 0.15s, border-color 0.15s;
}
.root-drop-zone.active-drop {
    background: var(--bg-hover);
    color: var(--text-bright);
    border-color: var(--accent);
}

.layer-vis {
    cursor: pointer;
    color: var(--text-dim);
    width: 20px;
    text-align: center;
    font-size: 14px;
    padding: 4px;
}
.layer-vis:hover { color: var(--text-bright); }

/* â”€â”€ Layer Lock Button â”€â”€ */
.layer-lock {
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
    color: var(--text-dim);
    opacity: 0.35;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    user-select: none;
}
.layer-lock:hover {
    opacity: 1;
    background: rgba(255,255,255,0.07);
    color: var(--text-bright);
}
.layer-lock.is-locked {
    opacity: 1;
    color: #f59e0b;
}
.layer-item.layer-is-locked {
    opacity: 0.7;
}
.layer-item.layer-is-locked .layer-name {
    text-decoration: line-through;
    text-decoration-color: rgba(245,158,11,0.45);
}

.layer-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    font-size: 11px;
}
.layer-tag {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    pointer-events: none;
}
.layer-tag input {
    display: none;
}
.is-masked {
    border-left: 3px solid var(--mask-color);
    padding-left: 5px;
}


/* ═══════════════════════════════════════════════════════════════
   Canvas Rotation Slider (Vertical) — top-right of the viewport
   Transparent by default; becomes fully visible on hover.
   Default value 50 maps to 0° rotation.
   ═══════════════════════════════════════════════════════════════ */
#canvasRotateSliderWrap {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 230px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 14px;
    background: rgba(15, 17, 20, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0.22;
    transition: opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    user-select: none;
}
#canvasRotateSliderWrap:hover,
#canvasRotateSliderWrap:focus-within,
#canvasRotateSliderWrap.is-active {
    opacity: 1;
    background: rgba(15, 17, 20, 0.88);
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(139, 92, 246, 0.18);
}
#canvasRotateSlider {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 18px;
    height: 165px;
    margin: 0;
    background: transparent;
    cursor: ns-resize;
    direction: ltr;
    touch-action: none;
}
#canvasRotateSlider::-webkit-slider-runnable-track {
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom,
        rgba(139, 92, 246, 0.75) 0%,
        rgba(139, 92, 246, 0.35) 50%,
        rgba(34, 197, 94, 0.75) 100%);
    border-radius: 3px;
}
#canvasRotateSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8b5cf6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    margin-left: -5px;
    cursor: ns-resize;
}
#canvasRotateSlider::-moz-range-track {
    width: 6px;
    background: linear-gradient(to bottom,
        rgba(139, 92, 246, 0.75) 0%,
        rgba(139, 92, 246, 0.35) 50%,
        rgba(34, 197, 94, 0.75) 100%);
    border-radius: 3px;
}
#canvasRotateSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8b5cf6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    cursor: ns-resize;
}
#canvasRotateValue {
    font-size: 10px;
    color: #e5e7eb;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 5px;
    border-radius: 4px;
    min-width: 38px;
    text-align: center;
    pointer-events: none;
}
#canvasRotateReset {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(139, 92, 246, 0.55);
    color: #e9d5ff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.2s;
}
#canvasRotateReset:hover {
    background: rgba(139, 92, 246, 0.45);
    transform: rotate(-90deg);
}
