:root {
    /* Color Palette - Dark Modern Neon */
    --bg-color: #0f172a;
    /* Slate 900 */
    --panel-bg: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #8b5cf6;
    /* Violet 500 */
    --accent-hover: #7c3aed;
    /* Violet 600 */
    --accent-glow: rgba(139, 92, 246, 0.5);
    --checkerboard-dark: #1e293b;
    --checkerboard-light: #334155;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.15) 0%, transparent 50%);
}

.hidden {
    display: none !important;
}

/* Glassmorphism utility */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

.app-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #c4b5fd, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.app-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Upload Screen */
.upload-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--accent-color);
    transition: all 0.3s ease;
}

.upload-area.dragover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #a78bfa;
    box-shadow: 0 0 20px var(--accent-glow);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 3rem;
}

.upload-icon {
    font-size: 4rem;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
    transition: transform 0.3s ease;
}

.upload-label:hover .upload-icon {
    transform: translateY(-5px);
}

.upload-label p {
    font-size: 1.2rem;
    font-weight: 500;
}

.upload-label .sub-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#file-input {
    display: none;
}

/* Editor Screen */
.editor-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    /* for scrollbar */
}

.editor-top-row {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
    min-height: 75vh;
}

.workspace {
    flex: 1;
    display: flex;
    gap: 1rem;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.canvas-title {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    touch-action: none; /* Prevent default touch actions (scroll/zoom) to allow custom pointer handling */
    /* Transformation handled by JS for zoom/pan */
    transform-origin: top left;
}

/* Checkerboard background for preview */
.checkerboard {
    background-image:
        linear-gradient(45deg, var(--checkerboard-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--checkerboard-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--checkerboard-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--checkerboard-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: var(--checkerboard-dark);
}


/* Control Panel */
.control-panel {
    width: 440px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.control-panel h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.label-with-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#threshold-value,
#shrink-value,
#defringe-value {
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c4b5fd;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    flex: 1;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tool-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* Color Palette */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 36px;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    align-items: center;
}

.palette-color {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.palette-color:hover {
    transform: scale(1.1);
}

.palette-color::after {
    content: '×';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.palette-color:hover::after {
    opacity: 1;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent-glow);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--checkerboard-light);
    border-radius: 2px;
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: var(--accent-color);
}

/* Checkboxes */
.checkboxes {
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem !important;
}

.checkbox-label input {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input:checked~.custom-checkbox {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

.checkbox-label input:checked~.custom-checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.actions {
    margin-top: auto;
    gap: 1rem;
}

button {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.help-text small {
    color: var(--text-secondary);
    line-height: 1.5;
}

small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Loading Spinner */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--accent-glow);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Spuit Indicator */
#indicators-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.spuit-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px black, inset 0 0 0 1px black;
    pointer-events: none;
    z-index: 15;
    transform: translate(-50%, -50%);
}

/* LINE Stamp Section */
.line-stamp-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.line-stamp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.line-stamp-header h3 {
    font-size: 1.2rem;
    color: #c4b5fd;
}

.stamp-editors-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.stamp-editor-block {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    max-width: none;
}

.editor-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.editor-top-bar h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.editor-main-area {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    align-items: flex-start;
}

.editor-left-panel {
    flex: 0 0 440px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 20px;
}

@media (max-width: 800px) {
    body {
        overflow-y: auto;
    }
    
    .app-container {
        height: auto;
        min-height: 100vh;
        padding: 1rem;
        gap: 1rem;
    }

    .app-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .mode-switch-container {
        display: none !important; /* Force hide toggle on mobile */
    }

    .editor-top-row {
        flex-direction: column;
        min-height: auto;
    }
    
    .workspace {
        flex-direction: column;
        overflow: visible;
    }
    
    .canvas-container {
        min-height: 250px;
        flex: none;
        width: 100%;
    }
    
    .control-panel {
        width: 100%;
        overflow-y: visible;
        padding: 1rem;
    }

    .editor-main-area {
        flex-direction: column;
        align-items: center;
    }

    .editor-left-panel {
        flex: auto;
        width: 100%;
    }
    
    .stamp-editor-block {
        padding: 1rem;
    }
    
    /* Prevent horizontal scroll for toolbars */
    .stamp-toolbar {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.25rem;
    }
    
    .stamp-btn, .save-single-btn {
        flex: 0 0 auto;       /* Don't grow/shrink; size by content */
        text-align: center;
        white-space: nowrap !important;  /* Never break button text */
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        line-height: 1.2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Responsive stamp canvas wrappers via CSS zoom */
    .stamp-canvas-wrapper {
        /* Let JS handle exact dimensions (e.g. 530x480). We scale it visually to fit mobile screens. */
        transform-origin: top center;
    }
    
    @media (max-width: 600px) {
        .stamp-canvas-wrapper { zoom: 0.7; }
    }
    @media (max-width: 480px) {
        .stamp-canvas-wrapper { zoom: 0.55; }
    }
    @media (max-width: 380px) {
        .stamp-canvas-wrapper { zoom: 0.45; }
    }
}



.stamp-canvas-wrapper {
    position: relative;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* キャンバスのはみ出しがUI操作を妨げないよう、キャンバス以外の要素を手前に配置 */
.stamp-editor-block>*:not(.stamp-canvas-wrapper) {
    position: relative;
    z-index: 10;
}

.stamp-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    align-items: center;
    overflow-x: auto;
}

/* ツールバーがはみ出さないようにスクロールバーを隠す */
.stamp-toolbar::-webkit-scrollbar {
    display: none;
}

.stamp-toolbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stamp-btn-group {
    display: flex;
    gap: 1px;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    padding: 0 4px;
    margin: 0 2px;
}

.stamp-btn {
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.stamp-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.stamp-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.stamp-canvas-wrapper {
    position: relative;
    background-color: #4b5563;
    /* Darker gray for interaction area */
    border: 1px solid var(--glass-border);
    overflow: visible;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.checkerboard-area {
    position: absolute;
    background-color: var(--checkerboard-dark);
    background-image: linear-gradient(45deg, var(--checkerboard-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--checkerboard-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--checkerboard-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--checkerboard-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    z-index: 0;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.stamp-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: default;
    transform-origin: center;
}

.stamp-scale-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stamp-scale-control input {
    flex: 1;
}

.save-single-btn {
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
}

/* Text Properties Panel */
.text-input-group {
    width: 100%;
    margin-bottom: 10px;
}

.text-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    color: #333;
}

.text-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.text-properties-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.prop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prop-row label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.text-properties-panel select,
.text-properties-panel input[type="number"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.8rem;
    outline: none;
}

.text-properties-panel select optgroup {
    background: #2d3748;
    color: #cbd5e0;
    font-weight: 600;
    font-style: normal;
}

.text-properties-panel select option {
    background: #1a202c;
    color: white;
}

.text-style-group {
    display: flex;
    gap: 4px;
}

.text-style-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-style-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Gradient Editor Styles */
.gradient-editor {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-bar-container {
    height: 24px;
    position: relative;
    margin: 10px 10px 20px 10px;
    cursor: copy;
}

.gradient-bar {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-stops {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gradient-stop {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
    z-index: 10;
}

.gradient-stop:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.gradient-stop.active {
    border-color: #fff;
    box-shadow: 0 0 8px var(--accent-glow);
    z-index: 20;
}

.gradient-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

.text-properties-panel input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--glass-border);
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.text-properties-panel input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.text-properties-panel input[type="color"]::-webkit-color-swatch {
    border: none;
}

.text-stroke-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-stroke-group input[type="range"] {
    width: 80px;
}

/* Text Editing Overlay */
#text-edit-overlay {
    position: absolute;
    z-index: 1000;
    background: transparent;
    border: 1px dashed var(--accent-color);
    color: white;
    font-family: sans-serif;
    padding: 0;
    margin: 0;
    overflow: hidden;
    resize: none;
    line-height: 1.2;
    outline: none;
    white-space: pre;
    text-shadow: none;
    /* Shadow handled by canvas, but we disable text shadow in textarea anyway */
}

/* Text Editor Overlay */
.text-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    display: none;
    pointer-events: none;
}

.text-editor-textarea {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-color);
    color: white;
    outline: none;
    padding: 0;
    margin: 0;
    resize: none;
    overflow: hidden;
    pointer-events: auto;
    white-space: pre;
    line-height: 1.2;
    transform-origin: top left;
}

.text-editor-textarea.vertical {
    writing-mode: vertical-rl;
}

/* Header layout for title and mode switch */
.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Mode Switch Container */
.mode-switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    user-select: none;
}

.mode-label {
    color: var(--text-secondary);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    font-weight: 500;
}

.mode-label.active {
    color: #c4b5fd;
    text-shadow: 0 0 8px rgba(196, 181, 253, 0.4);
    font-weight: 600;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(56, 189, 248, 0.1);
    border: 1px solid #38bdf8;
    transition: .3s;
    border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* Checked (Simple Mode) state */
.switch input:checked + .slider {
    background-color: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Simple Mode UI Hiding Rules */
.mode-simple #group-shrink,
.mode-simple #group-defringe,
.mode-simple #group-checkboxes,
.mode-simple [data-action="center"],
.mode-simple [data-action="top"],
.mode-simple [data-action="bottom"],
.mode-simple [data-action="left"],
.mode-simple [data-action="right"],
.mode-simple [data-action="flipH"],
.mode-simple [data-action="flipV"],
.mode-simple .stamp-btn-group,
.mode-simple .editor-left-panel {
    display: none !important;
}