        * {
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            overflow: hidden !important; /* 브라우저 전체 스크롤 절대 차단 */
            margin: 0;
            padding: 0;
            width: 100%;
        }

        body {
            font-family: var(--font-ui, var(--font-sans, 'Inter', system-ui, sans-serif));
            background-color: var(--background);
            color: var(--foreground);
            margin: 0;
            padding: 0;
            -webkit-font-smoothing: antialiased;
        }

        .app-container {
            display: flex;
            height: 100%;
            width: 100%;
            background-color: var(--background);
            overflow: hidden;
        }

        /* Sidebar Styles */
        .sidebar {
            background-color: var(--card);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
            z-index: 20;
            width: var(--sidebar-width, 280px);
            height: 100%; /* 부모 높이에 맞춤 */
            overflow: hidden;
        }

        .sidebar-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            height: 74px;
            display: flex;
            align-items: center;
        }

        .sidebar-header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .logo-section {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .logo-icon {
            color: var(--primary);
            font-size: 1.5rem;
        }

        .logo-text {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--foreground);
        }

        .sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

        /* Keep the editor sidebar from falling back to the browser's bright
           platform scrollbar. The narrow, inset thumb stays visible without
           competing with the annotation controls. */
        .sidebar-content,
        .sidebar-tab-panel {
            scrollbar-width: thin;
            scrollbar-color: #64748b transparent;
            scrollbar-gutter: stable;
        }

        .sidebar-content::-webkit-scrollbar,
        .sidebar-tab-panel::-webkit-scrollbar {
            width: 10px;
        }

        .sidebar-content::-webkit-scrollbar-track,
        .sidebar-tab-panel::-webkit-scrollbar-track {
            background: transparent;
        }

        .sidebar-content::-webkit-scrollbar-thumb,
        .sidebar-tab-panel::-webkit-scrollbar-thumb {
            background: #64748b;
            border: 3px solid transparent;
            border-radius: 999px;
            background-clip: content-box;
        }

        .sidebar-content::-webkit-scrollbar-thumb:hover,
        .sidebar-tab-panel::-webkit-scrollbar-thumb:hover {
            background-color: rgba(71, 85, 105, 0.78);
        }

        .dark .sidebar-content,
        .dark .sidebar-tab-panel,
        [data-theme='dark'] .sidebar-content,
        [data-theme='dark'] .sidebar-tab-panel {
            scrollbar-color: rgba(148, 163, 184, 0.58) transparent;
        }

        .dark .sidebar-content::-webkit-scrollbar-thumb,
        .dark .sidebar-tab-panel::-webkit-scrollbar-thumb,
        [data-theme='dark'] .sidebar-content::-webkit-scrollbar-thumb,
        [data-theme='dark'] .sidebar-tab-panel::-webkit-scrollbar-thumb {
            background-color: rgba(148, 163, 184, 0.58);
        }

        .dark .sidebar-content::-webkit-scrollbar-thumb:hover,
        .dark .sidebar-tab-panel::-webkit-scrollbar-thumb:hover,
        [data-theme='dark'] .sidebar-content::-webkit-scrollbar-thumb:hover,
        [data-theme='dark'] .sidebar-tab-panel::-webkit-scrollbar-thumb:hover {
            background-color: rgba(203, 213, 225, 0.74);
        }

        .tool-panel {
            margin-bottom: 1.5rem;
        }

        .panel-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--foreground);
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.5rem;
        }

        .panel-title-left {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Keep title and pulldown on a single row for style-section headers */
        .style-section.panel-title {
            justify-content: flex-start;
            align-items: center;
            flex-wrap: nowrap;
            gap: 0.75rem;
        }

        /* Fixed label width on the left; control fills remaining space */
        .style-section.panel-title .panel-title-left { flex: 0 0 var(--label-width); min-width: var(--label-width); padding: 0 4px; }
        .style-section.panel-title .panel-inline-control { flex: 1 1 auto; min-width: 0; }


        .panel-inline-control {
            flex-shrink: 0;
            min-width: 120px;
        }

        .panel-inline-control select {
            width: 100%;
            font-size: 0.8rem;
        }

        #shapeSection .panel-inline-control {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0.35rem;
        }

        .inline-hint {
            color: var(--muted-foreground);
            font-size: 0.72rem;
            line-height: 1.2;
            white-space: nowrap;
        }

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

        .size-slider-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 44px;
            align-items: center;
            gap: 0.5rem;
        }

        #sizeSelector {
            width: 100%;
            accent-color: var(--primary);
        }

        .color-control-grid {
            display: grid;
            gap: 0.5rem;
            width: 100%;
        }

        .color-picker-row {
            display: grid;
            grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
            gap: 0.4rem;
            align-items: center;
        }

        #customColorPicker {
            width: 2.5rem;
            height: 2.5rem;
            padding: 0.15rem;
            cursor: pointer;
        }

        #customColorHex {
            width: 100%;
            min-width: 0;
            text-transform: uppercase;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 0.8rem;
        }

        .color-eyedropper {
            width: 2.5rem;
            height: 2.5rem;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .color-eyedropper:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        #sizeValuePreview {
            color: var(--muted-foreground);
            font-size: 0.75rem;
            font-variant-numeric: tabular-nums;
            text-align: right;
        }

        .annotation-size-preview {
            min-height: 160px;
            padding: 0.5rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: linear-gradient(135deg, var(--secondary), var(--card));
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            overflow: hidden;
        }

        #sizePreviewModeLabel {
            color: var(--muted-foreground);
            font-size: 0.72rem;
            line-height: 1;
        }

        .size-preview-stage {
            min-height: 144px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            overflow: hidden;
        }

        .size-preview-stage [hidden] {
            display: none !important;
        }

        #sizePreviewCanvas {
            width: 144px;
            height: 144px;
            display: block;
        }

        #sizePreviewBubble {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            border-radius: 999px;
            color: #ffffff;
            font-family: Arial, sans-serif;
            font-weight: 700;
            line-height: 1;
        }

        #sizePreviewText {
            font-family: Arial, sans-serif;
            line-height: 1;
            white-space: nowrap;
        }

        #sizePreviewEmoji {
            line-height: 1;
        }


        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0.5rem 1rem;
            border-radius: var(--radius);
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.2s;
            cursor: pointer;
            border: 1px solid var(--border);
            background-color: var(--background);
            color: var(--foreground);
            text-decoration: none;
            min-height: 2.5rem;
        }

        .btn:hover {
            background-color: var(--muted);
        }

        .btn.primary {
            background-color: var(--primary);
            color: var(--primary-foreground);
            border-color: var(--primary);
        }

        .btn.primary:hover {
            background-color: var(--primary);
            opacity: 0.9;
        }

        .btn.btn-icon {
            padding: 0.5rem;
            width: 2.5rem;
            height: 2.5rem;
            justify-content: center;
        }

        .btn.btn-icon .material-icons {
            margin: 0;
        }

        .btn.success {
            background-color: var(--success-color);
            color: white;
            border-color: var(--success-color);
        }

        .btn.success:hover {
            background-color: var(--success-color);
            opacity: 0.9;
        }

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

        .btn-row {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }


        select {
            width: 100%;
            padding: 0.5rem 2rem 0.5rem 0.75rem;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background-color: var(--background);
            color: var(--foreground);
            font-size: 0.875rem;
            min-height: 2.5rem;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
        }

        select:focus {
            outline: none;
            border-color: var(--ring);
            box-shadow: var(--focus-ring, 0 0 0 2px rgba(59, 130, 246, 0.1));
        }

        input[type="file"] {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background-color: var(--background);
            color: var(--foreground);
            font-size: 0.875rem;
            cursor: pointer;
        }


        .style-section {
            margin-bottom: 1rem;
        }

        /* ---- Custom dropdown (design-system approved pattern) ---- */
        .dd {
            position: relative;
            width: 100%;
        }

        /* Top bar resize selector wrapper inherits flex sizing */
        .resize-control-row .dd {
            flex: 1;
            min-width: 130px;
            width: auto;
        }

        .resize-control-row .dd .dd-btn {
            position: relative;
            z-index: 120;
            pointer-events: auto;
        }

        .dd-btn {
            width: 100%;
            height: 2.5rem;
            padding: 0 0.75rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--background);
            color: var(--foreground);
            font-size: 0.875rem;
            font-family: var(--font-ui, var(--font-sans));
            font-weight: 400;
            cursor: pointer;
            text-align: left;
            transition: background 0.15s;
            min-height: 2.5rem;
        }

        .dd-btn:hover {
            background: var(--muted);
        }

        .dd-btn .dd-chev {
            width: 12px;
            height: 12px;
            flex-shrink: 0;
            color: var(--muted-foreground);
            transition: transform 0.15s;
        }

        .dd.dd-open .dd-btn {
            border-color: var(--ring);
            box-shadow: var(--focus-ring);
        }

        .dd.dd-open .dd-chev {
            transform: rotate(180deg);
        }

        .dd-menu {
            display: none;
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% + 4px);
            background: var(--background);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
            padding: 0.25rem;
            z-index: 200;
            font-size: 0.875rem;
            font-family: var(--font-ui, var(--font-sans));
        }

        .dd.dd-open .dd-menu {
            display: block;
        }

        .dd.dd-up .dd-menu {
            top: auto;
            bottom: calc(100% + 4px);
        }

        .dd-opt {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.45rem 0.55rem;
            border-radius: 0.375rem;
            cursor: pointer;
            color: var(--foreground);
        }

        .dd-opt:hover {
            background: var(--muted);
        }

        .dd-opt.dd-selected {
            background: rgba(59, 130, 246, 0.08);
            color: var(--primary);
            font-weight: 500;
        }

        .dd-opt .dd-check {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
            color: var(--primary);
            opacity: 0;
        }

        .dd-opt.dd-selected .dd-check {
            opacity: 1;
        }

        /* Dark mode adjustments */
        .dark .dd-opt.dd-selected {
            background: rgba(59, 130, 246, 0.15);
        }

        .dark .dd-menu {
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
        }

        /* Make clipboard paste button span full row */
        #clipboardButton { flex: 1 0 100%; }

        @media (max-width: 768px) {
            /* 모바일에서 인라인 컨트롤 조정 */
            .panel-inline-control {
                min-width: 100px;
                max-width: 140px;
            }
            
            .panel-inline-control select {
                font-size: 0.75rem;
                padding: 4px 8px;
            }
            
            .panel-title {
                gap: 0.25rem;
            }
            
            .panel-title-left {
                gap: 0.25rem;
                min-width: 0;
                flex-shrink: 1;
            }
            
            .panel-title-left span {
                font-size: 0.8rem;
            }
            
            /* 모바일에서 사이드바가 표시될 때 인라인 레이아웃 유지 */
            .mobile-device .style-section.panel-title {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            
            .mobile-device .panel-inline-control {
                flex-shrink: 0;
                min-width: 90px;
                max-width: 120px;
            }
        }

        .style-subtitle {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--muted-foreground);
            margin-bottom: 0.5rem;
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }

        .footer-links {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .footer-link {
            justify-content: flex-start;
            gap: 0.75rem;
            font-size: 0.825rem;
            color: var(--muted-foreground);
            text-decoration: none;
            background-color: transparent;
            border: none;
            padding: 0.75rem;
        }

        .footer-link:hover {
            background-color: var(--muted);
            color: var(--foreground);
        }

        .footer-link .material-icons {
            font-size: 1rem;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            background-color: var(--background);
            min-height: 0; /* Flex 자식이 부모를 넘지 못하게 방어 */
            min-width: 0;
            overflow: hidden;
        }

        .top-bar {
            background-color: var(--card);
            border-bottom: 1px solid var(--border);
            padding: 0 1rem;
            min-height: var(--editor-toolbar-height);
            height: var(--editor-toolbar-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            position: sticky;
            top: 0;
            z-index: 100;
            pointer-events: auto;
        }

        .top-bar h2 {
            font-size: 1.125rem;
            font-weight: 500;
            color: var(--foreground);
            margin: 0;
            flex: 0 0 auto;
            white-space: nowrap;
        }

        .top-bar-actions {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            justify-content: flex-end;
            gap: 0.5rem;
            flex: 1 1 auto;
            min-width: 0;
            position: relative;
            z-index: 110;
            pointer-events: auto;
        }

        .chrome-extension-link:hover {
            background: linear-gradient(135deg, #3367d6, #2d8659) !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }

        .chrome-extension-link:active {
            transform: translateY(0);
        }

        /* 모바일 전용 UI - User Agent 기반 */
        .mobile-device .chrome-extension-link {
            display: none !important; /* 모바일에서 완전히 숨김 */
        }
        
        .mobile-device .top-bar-actions {
            gap: 0.25rem;
        }
        
        .mobile-device .top-bar-actions label {
            font-size: 0.75rem !important;
        }
        
        /* 모바일에서 리사이즈 옵션 숨기기 */
        .mobile-device .top-resize-selector option:not([value=""]):not([value="auto"]) {
            display: none;
        }
        
        /* 모바일에서 불필요한 컨트롤들 숨기기 */
        .mobile-device .sidebar .control-group:has(.top-resize-selector) label {
            display: none;
        }
        
        /* 인스타그램 스타일 상단바 */
        .mobile-device .top-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            justify-content: center;
            padding: 1rem 3rem;
            min-height: 60px;
            background-color: rgba(0, 0, 0, 0.8); /* 반투명 검은 배경 */
            backdrop-filter: blur(10px); /* 블러 효과 */
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 95; /* 최상위 */
        }
        
        .mobile-device .top-bar::before {
            content: "AnnotateShot";
            font-size: 1.25rem;
            font-weight: 600;
            color: #FFFFFF; /* 인스타그램 스타일 흰색 텍스트 */
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 10;
        }
        
        /* 모바일에서 상단바의 모든 컨트롤 숨기기 */
        .mobile-device .top-bar-actions {
            display: none !important;
        }
        
        .mobile-device .top-bar .chrome-extension-link,
        .mobile-device .top-bar select,
        .mobile-device .top-bar label {
            display: none !important;
        }
        
        /* 모바일에서 햄버거 메뉴 완전 숨기기 */
        .mobile-device .mobile-menu-btn-removed {
            display: none !important;
        }
        
        /* 모바일에서 PC 사이드바 비활성화 */
        .mobile-device .sidebar {
            display: none !important;
        }
        
        .mobile-device .layer-sidebar {
            display: none !important;
        }
        
        /* 데스크톱에서 모바일 전용 요소 완전 숨김 */
        .mobile-only {
            display: none !important;
        }
        
        /* 모바일에서만 모바일 전용 요소 표시 */
        .mobile-device .mobile-only {
            display: block !important;
        }
        
        /* 데스크톱에서 모바일 툴바 강제 숨김 */
        body:not(.mobile-device) .mobile-toolbar,
        body:not(.mobile-device) .floating-action-buttons,
        body:not(.mobile-device) .emoji-layer {
            display: none !important;
        }
        
        /* 모바일에서 사이드바 헤더 조정 */
        .mobile-device .sidebar-header .logo-text {
            display: block; /* 텍스트는 다시 표시 */
        }
        
        /* 모바일에서 "이미지편집" 텍스트만 숨김 - 더 강한 선택자 */
        .mobile-device .sidebar-header .logo-text .desktop-text {
            display: none !important;
        }
        
        /* 모바일에서 아이콘을 이미지로 교체 - 더 강한 선택자 */
        .mobile-device .sidebar-header .logo-icon {
            font-size: 0 !important; /* Material Icons 텍스트 숨김 */
            width: 1.5rem !important;
            height: 1.5rem !important;
            background-image: url('extension/icon.png') !important;
            background-size: contain !important;
            background-repeat: no-repeat !important;
            background-position: center !important;
            display: inline-block !important;
        }
        
        .mobile-device .sidebar-header {
            padding: 1rem;
            text-align: center;
        }

        .resize-control {
            display: grid;
            grid-template-columns: minmax(260px, 330px) minmax(300px, 1fr);
            align-items: center;
            gap: 0.75rem;
            min-width: 300px;
            max-width: none;
            flex: 1 1 auto;
            padding: 0;
            border: 0;
            background: transparent;
        }

        .resize-control-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .resize-control-label {
            color: var(--muted-foreground);
            cursor: pointer;
            font-size: 0.8rem;
            white-space: nowrap;
            flex: 0 0 auto;
        }

        .top-resize-selector {
            min-width: 130px;
            flex: 1;
            padding: 0.5rem 2rem 0.5rem 0.75rem;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background-color: var(--background);
            color: var(--foreground);
            font-size: 0.875rem;
            min-height: 2.5rem;
            cursor: pointer;
            position: relative;
            z-index: 120;
            pointer-events: auto;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
            background-size: 12px 12px;
        }

        .dark .top-resize-selector {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
        }

        .top-resize-selector:focus {
            outline: none;
            border-color: var(--ring);
            box-shadow: var(--focus-ring, 0 0 0 2px rgba(59, 130, 246, 0.1));
            z-index: 121;
        }

        .top-resize-selector:hover {
            background-color: var(--muted);
        }

        .resize-apply-button {
            min-height: 2.35rem;
            white-space: nowrap;
        }

        .resize-apply-cluster {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            flex: 0 0 auto;
        }

        .resize-apply-hint {
            display: none;
            color: var(--warning);
            font-size: 0.72rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .resize-control--dirty .resize-apply-button {
            border-color: var(--warning, #f59e0b);
            box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
        }

        .resize-control--dirty .resize-apply-hint {
            display: inline-flex;
        }

        .resize-dimensions {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.35rem 0.75rem;
            color: var(--muted-foreground);
            font-size: 0.75rem;
            line-height: 1.3;
            min-width: 0;
        }

        .resize-dimensions strong {
            color: var(--foreground);
            font-variant-numeric: tabular-nums;
        }

        .resize-custom-panel {
            display: grid;
            grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.7fr) auto;
            align-items: center;
            gap: 0.9rem;
            min-width: 0;
            padding: 0.35rem 1rem;
            border-bottom: 1px solid var(--border);
            background: var(--card);
        }

        .resize-custom-panel[hidden] {
            display: none;
        }

        .resize-slider-label,
        .resize-lock-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            color: var(--muted-foreground);
            font-size: 0.75rem;
        }

        .resize-slider-label strong {
            color: var(--foreground);
            font-variant-numeric: tabular-nums;
        }

        #resizeScaleSlider {
            width: 100%;
            min-width: 0;
        }

        .resize-slider-group {
            display: grid;
            grid-template-columns: auto 44px minmax(0, 1fr);
            align-items: center;
            gap: 0.45rem;
            min-width: 0;
        }

        .resize-slider-group .resize-slider-label {
            display: contents;
        }

        .resize-exact-inputs {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 0.5rem;
        }

        .resize-exact-inputs label {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            gap: 0.35rem;
            color: var(--muted-foreground);
            font-size: 0.75rem;
        }

        .resize-exact-inputs input {
            width: 100%;
            min-width: 0;
            padding: 0.3rem 0.45rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--background);
            color: var(--foreground);
            font-size: 0.8rem;
        }

        .resize-lock-option {
            justify-content: flex-start;
            white-space: nowrap;
        }

        @media (max-width: 1180px) {
            .resize-control {
                grid-template-columns: minmax(220px, 300px) minmax(240px, 1fr);
            }

            .resize-custom-panel {
                grid-template-columns: minmax(220px, 1fr) minmax(200px, 0.8fr) auto;
            }
        }

        @media (max-width: 900px) {
            .top-bar {
                flex-wrap: wrap;
                align-items: flex-start;
            }

            .top-bar-actions {
                width: 100%;
            }

            .resize-control,
            .resize-custom-panel {
                grid-template-columns: 1fr;
            }
        }


        .canvas-area {
            flex: 1;
            padding: 1rem;
            display: flex;
            justify-content: center;
            align-items: flex-start; /* 상단 정렬로 변경하여 큰 이미지 스크롤 가능 */
            background-color: var(--muted);
            background-image:
                radial-gradient(circle, var(--border) 1px, transparent 1px);
            background-size: 20px 20px;
            min-height: 0; /* Flex 자식이 부모를 넘지 못하게 방어 */
            overflow: auto; /* 내부 스크롤만 허용 */
        }

        .canvas-container {
            position: relative;
            background: var(--card);
            border-radius: calc(var(--radius) * 2);
            padding: 1rem;
            box-shadow: var(--shadow-md, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
            max-width: 100%;
            overflow: visible; /* canvas-area에서만 스크롤 처리 */
            /* 컨테이너 내부 콘텐츠를 항상 상단부터 표시 */
            display: inline-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            flex-shrink: 0; /* 컨테이너가 줄어들지 않도록 */
        }

        /* 캔버스가 컨테이너 너비를 초과하지 않도록 제한 */
        #imageCanvas, #mobileImageCanvas {
            max-width: 100%;
            height: auto !important;
        }

        #imageCanvas {
            border-radius: var(--radius);
            display: inline-block;
            vertical-align: top; /* 캔버스를 항상 상단에 정렬 */
            margin: 0; /* 기본 마진 제거 */
        }
        
        #imageCanvas.default-canvas {
            max-width: 100%;
            max-height: 100%;
        }

        #imageCanvas.transparent-background {
            background-image: 
                linear-gradient(45deg, #e0e0e0 25%, transparent 25%), 
                linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #e0e0e0 75%), 
                linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
            background-size: 60px 60px;
            background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
            background-color: #ffffff;
        }

        .status-bar {
            background-color: var(--card);
            border-top: 1px solid var(--border);
            padding: 0.5rem 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            color: var(--muted-foreground);
            font-family: 'Courier New', monospace;
        }

        .status-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        #statusText {
            color: var(--muted-foreground);
            background-color: var(--muted);
            padding: 0.25rem 0.5rem;
            border-radius: calc(var(--radius) / 2);
            font-size: 0.8rem;
            min-width: 200px;
            text-align: center;
        }

        /* Message */
        #message {
            position: fixed;
            top: 1rem;
            right: 1rem;
            background-color: var(--success-color);
            color: white;
            padding: 0.75rem 1rem;
            border-radius: var(--radius);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            z-index: 9999999;
            pointer-events: none;
        }

        #message.show {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        /* Material Icons */
        .material-icons {
            font-family: 'Material Icons';
            font-weight: normal;
            font-style: normal;
            font-size: 1.25rem;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            display: inline-block;
            white-space: nowrap;
            word-wrap: normal;
            direction: ltr;
            font-feature-settings: 'liga';
            -webkit-font-feature-settings: 'liga';
            -webkit-font-smoothing: antialiased;
        }

        /* Layer Sidebar Styles */
        .layer-sidebar {
            background-color: var(--card);
            border-left: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1), -2px 0 4px -1px rgba(0, 0, 0, 0.06);
            z-index: 20;
            width: var(--layer-sidebar-width, 280px);
            height: 100%;
            overflow: hidden;
            transition: width 0.3s ease;
        }

        .layer-sidebar.collapsed {
            width: 50px;
        }

        .layer-sidebar.collapsed .layer-sidebar-content,
        .layer-sidebar.collapsed .layer-sidebar-header-content {
            display: none;
        }

        .layer-sidebar.collapsed .layer-sidebar-toggle .material-icons {
            transform: rotate(180deg);
        }

        .layer-sidebar-toggle {
            padding: 0.5rem;
            background: transparent;
            border: none;
            color: var(--muted-foreground);
            cursor: pointer;
            border-radius: var(--radius);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .layer-sidebar-toggle:hover {
            background-color: var(--accent);
            color: var(--accent-foreground);
        }

        .layer-sidebar-toggle .material-icons {
            transition: transform 0.3s ease;
        }

        .layer-sidebar-header {
            background-color: var(--muted);
            border-bottom: 1px solid var(--border);
            padding: 1rem;
            min-height: 74px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .layer-sidebar-header-content {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
        }

        .layer-sidebar-header h3 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--foreground);
            margin: 0;
            flex: 1;
        }

        .layer-sidebar-collapse {
            padding: 0.375rem;
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            border-radius: 0.375rem;
            transition: all 0.2s ease;
        }

        .layer-sidebar-collapse:hover {
            background-color: var(--accent);
            color: var(--accent-foreground);
        }

        .layer-sidebar.collapsed .layer-sidebar-collapse .material-icons {
            transform: rotate(180deg);
        }

        .layer-sidebar-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .layer-sidebar.collapsed .layer-sidebar-content {
            display: none;
        }

        .layer-list {
            flex: 1;
            overflow-y: auto;
            padding: 0.5rem;
        }

        .layer-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            background-color: var(--background);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .layer-item:hover {
            background-color: var(--accent);
            border-color: var(--primary);
        }

        .layer-item.selected {
            background-color: var(--primary);
            color: var(--primary-foreground);
            border-color: var(--primary);
        }

        .layer-item.background-layer {
            opacity: 0.8;
        }

        .layer-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex: 1;
        }

        .layer-icon {
            font-size: 1.25rem;
            color: var(--muted-foreground);
        }

        /* Inline SVG icon wrapper — design system .ic pattern */
        .ic {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--muted-foreground);
        }

        .ic svg {
            width: 100%;
            height: 100%;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .layer-item.selected .ic {
            color: var(--primary-foreground);
        }

        /* Visibility / delete buttons in layer list */
        .layer-visibility-toggle .ic {
            width: 16px;
            height: 16px;
        }

        .layer-visibility-toggle.hidden .ic {
            opacity: 0.35;
        }

        .layer-item.selected .layer-icon {
            color: var(--primary-foreground);
        }

        .layer-name {
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--foreground);
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .layer-item.selected .layer-name {
            color: var(--primary-foreground);
        }

        .layer-controls {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .layer-visibility-toggle {
            padding: 0.25rem;
            background: transparent;
            border: none;
            color: var(--muted-foreground);
            cursor: pointer;
            border-radius: 0.25rem;
            transition: all 0.2s ease;
        }

        .layer-visibility-toggle:hover {
            background-color: var(--accent);
        }

        .layer-visibility-toggle.hidden .material-icons {
            opacity: 0.3;
        }

        .layer-item.selected .layer-visibility-toggle {
            color: var(--primary-foreground);
        }

        .layer-actions {
            padding: 1rem;
            border-top: 1px solid var(--border);
        }

        .layer-actions .btn {
            width: 100%;
            justify-content: center;
            gap: 0.5rem;
            font-size: 0.875rem;
        }

        /* 모바일 전용 레이아웃 - User Agent 기반 */
        .mobile-device .sidebar {
            position: fixed;
            left: -280px;
            height: 100vh;
            z-index: 90;
            transition: left 0.3s ease;
        }

        .mobile-device .sidebar.mobile-open {
            left: 0;
        }

        .mobile-device .sidebar.collapsed {
            left: -60px;
        }

        .mobile-device .main-content {
            width: 100%;
        }

        .mobile-device .layer-sidebar {
            position: fixed;
            right: -280px;
            height: 100vh;
            z-index: 90;
            transition: right 0.3s ease;
        }

        .mobile-device .layer-sidebar.mobile-open {
            right: 0;
        }

        .mobile-device .layer-sidebar.collapsed {
            right: -50px;
        }

        .mobile-device .mobile-overlay {
            position: fixed;
            inset: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 25;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
        }

        .mobile-device .mobile-overlay.show {
            opacity: 1;
            pointer-events: auto;
        }

        .mobile-device .top-bar {
            padding-left: 3rem;
        }

        .mobile-device .mobile-menu-btn-removed {
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 35;
            background-color: var(--primary);
            color: var(--primary-foreground);
            border: none;
            padding: 0.75rem;
            border-radius: var(--radius);
            cursor: pointer;
            display: block !important;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
        }

        .mobile-device .mobile-menu-btn-removed:hover {
            background-color: var(--primary);
            transform: scale(1.05);
        }

        .mobile-device .mobile-menu-btn-removed:active {
            transform: scale(0.95);
        }

        /* 데스크톱에서는 모바일 요소들 숨기기 */
        .desktop-device .mobile-menu-btn-removed {
            display: none !important;
        }

        .desktop-device .mobile-overlay {
            display: none;
        }

        /* 모바일 터치 최적화 */
        .mobile-device button, 
        .mobile-device select, 
        .mobile-device input[type="range"],
        .mobile-device .button {
            min-height: 44px !important;
            min-width: 44px !important;
            font-size: 16px !important; /* iOS 줌 방지 */
            padding: 0.75rem 1rem !important;
        }

        .mobile-device .control-group button {
            padding: 0.875rem 1.25rem !important;
            font-size: 0.9rem !important;
            border-radius: 8px !important;
        }

        .mobile-device .color-option {
            width: 48px !important;
            height: 48px !important;
            border-radius: 50% !important;
            border: 3px solid var(--border) !important;
            margin: 0.25rem !important;
        }

        .mobile-device .size-display,
        .mobile-device .number-count {
            font-size: 1.1rem !important;
            padding: 0.75rem !important;
            min-height: 44px !important;
        }

        /* 모바일 전용 플로팅 버튼 - 인스타그램 스타일 */
        .mobile-device .floating-action-buttons {
            position: fixed;
            bottom: 140px; /* 하단 툴바 위쪽으로 이동 */
            right: 1rem; /* 오른쪽 여백 줄임 */
            z-index: 100; /* 높은 z-index로 항상 최상위 */
            display: flex;
            flex-direction: column;
            gap: 0.5rem; /* 간격 줄임 */
        }

        .mobile-device .fab {
            width: 48px; /* 크기 줄임 */
            height: 48px; /* 크기 줄임 */
            border-radius: 50%;
            background-color: var(--primary);
            color: var(--primary-foreground);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem; /* 아이콘 크기 조정 */
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
            cursor: pointer;
            transition: all 0.2s ease;
            backdrop-filter: blur(10px);
        }

        .mobile-device .fab:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        }

        .mobile-device .fab:active {
            transform: scale(0.95);
        }

        .mobile-device .fab.save {
            background-color: var(--success-color);
        }

        .mobile-device .fab.undo {
            background-color: var(--muted);
            color: rgba(255, 255, 255, 0.7);
        }

        /* 모바일에서 캔버스 터치 동작 최적화 */
        .mobile-device .canvas-container {
            touch-action: none; /* 브라우저 기본 터치 동작 방지 */
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .mobile-device #imageCanvas {
            touch-action: none;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        /* 모바일 전용 하단 툴바 */
        .mobile-device .mobile-toolbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.8); /* 반투명 검은 배경 */
            backdrop-filter: blur(10px); /* 블러 효과 */
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding: 1rem;
            z-index: 90;
            display: flex;
            justify-content: space-around;
            align-items: center;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        }

        .mobile-device .mobile-toolbar .toolbar-button {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            padding: 0.5rem;
            border: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.75rem;
            cursor: pointer;
            min-width: 44px;
            min-height: 44px;
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .mobile-device .mobile-toolbar .toolbar-button.active {
            background-color: rgba(255, 255, 255, 0.2);
            color: #FFFFFF;
        }

        .mobile-device .mobile-toolbar .toolbar-button:hover {
            background-color: rgba(255, 255, 255, 0.1);
            color: #FFFFFF;
        }
        
        /* 이모지 선택 레이어 */
        .mobile-device .emoji-layer {
            position: fixed;
            bottom: 90px; /* 툴바 위쪽 */
            left: 1rem;
            right: 1rem;
            background: rgba(0, 0, 0, 0.95);
            border-radius: 12px;
            padding: 1rem;
            z-index: 1000;
            animation: slideUp 0.3s ease-out;
        }
        
        .mobile-device .emoji-layer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .mobile-device .emoji-layer-header h3 {
            color: #FFFFFF;
            margin: 0;
            font-size: 1.1rem;
        }
        
        .mobile-device .emoji-close-btn {
            background: none;
            border: none;
            color: #FFFFFF;
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 50%;
            transition: background-color 0.2s ease;
        }
        
        .mobile-device .emoji-close-btn:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .mobile-device .emoji-layer-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 0.75rem;
        }
        
        .mobile-device .emoji-layer-btn {
            width: 48px;
            height: 48px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        
        .mobile-device .emoji-layer-btn:hover,
        .mobile-device .emoji-layer-btn.selected {
            border-color: #FFF;
            background-color: rgba(255, 255, 255, 0.2);
            transform: scale(1.05);
        }
        
        @keyframes slideUp {
            from {
                transform: translateY(100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* 인스타그램 스타일 메인 콘텐츠 - 스크롤 없는 전체화면 */
        .mobile-device .main-content {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100vw !important;
            height: 100vh !important;
            padding: 0 !important;
            margin: 0 !important;
            max-width: none !important;
            overflow: hidden !important; /* 모든 스크롤 방지 */
            background: #000 !important; /* 검은 배경 */
        }
        
        /* 인스타그램 스타일 전체화면 이미지 편집 모드 */
        .mobile-device .canvas-container {
            position: fixed !important;
            top: 50px !important; /* 상단바 아래 */
            left: 0 !important;
            width: 100vw !important;
            height: calc(100vh - 140px) !important; /* 상단바와 하단 툴바 제외 */
            padding: 0 !important;
            margin: 0 !important;
            background: #000 !important; /* 검은 배경 */
            border-radius: 0 !important; /* 모서리 둥글게 제거 */
            box-shadow: none !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            z-index: 1 !important;
            overflow: hidden !important;
        }
        
        /* 인스타그램 스타일 캔버스 - 화면에 맞게 스케일링 */
        .mobile-device #imageCanvas {
            max-width: 100vw !important;
            max-height: calc(100vh - 140px) !important;
            width: auto !important;
            height: auto !important;
            margin: 0 !important;
            border-radius: 0 !important;
            border: none !important;
            box-shadow: none !important;
            object-fit: contain !important; /* 비율 유지하며 화면에 맞춤 */
            background: transparent !important;
        }

        /* 모바일 전용 모드 선택 패널 */
        .mobile-device .mobile-mode-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            z-index: 50;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: 90vw;
            max-height: 80vh;
            overflow-y: auto;
            display: none;
        }

        .mobile-device .mobile-mode-panel.show {
            display: block;
        }

        .mobile-device .mode-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-top: 1rem;
        }

        .mobile-device .mode-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1.5rem 1rem;
            border: 2px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            min-height: 100px;
            background-color: var(--background);
        }

        .mobile-device .mode-card:hover,
        .mobile-device .mode-card.active {
            border-color: var(--primary);
            background-color: var(--primary);
            color: var(--primary-foreground);
        }

        .mobile-device .mode-card .material-icons {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .mobile-device .mode-card .mode-name {
            font-size: 0.9rem;
            font-weight: 500;
            text-align: center;
        }
        
        /* 모바일 설정 패널 */
        .mobile-device .mobile-settings-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            z-index: 60;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: 90vw;
            max-height: 80vh;
            overflow-y: auto;
            display: none;
            min-width: 300px;
        }
        
        .mobile-device .mobile-settings-panel.show {
            display: block;
        }
        
        .mobile-device .setting-section {
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .mobile-device .setting-section:last-of-type {
            border-bottom: none;
            margin-bottom: 0;
        }
        
        .mobile-device .mobile-color-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
        }
        
        .mobile-device .mobile-color-btn {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 3px solid var(--border);
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
        }
        
        .mobile-device .mobile-color-btn:hover,
        .mobile-device .mobile-color-btn.active {
            transform: scale(1.1);
            border-color: var(--foreground);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
        
        .mobile-device .mobile-color-btn.active::after {
            content: "✓";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
            font-size: 1.2rem;
            font-weight: bold;
        }
        
        .mobile-device .mobile-size-slider input[type="range"] {
            appearance: none;
            height: 6px;
            background: var(--muted);
            outline: none;
            border-radius: 3px;
        }
        
        .mobile-device .mobile-size-slider input[type="range"]::-webkit-slider-thumb {
            appearance: none;
            width: 24px;
            height: 24px;
            background: var(--primary);
            cursor: pointer;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .mobile-device .mobile-emoji-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 0.5rem;
        }
        
        .mobile-device .mobile-emoji-btn {
            width: 44px;
            height: 44px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--background);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        
        .mobile-device .mobile-emoji-btn:hover,
        .mobile-device .mobile-emoji-btn.active {
            border-color: var(--primary);
            background-color: var(--primary);
            transform: scale(1.05);
        }
        
        .mobile-device .mobile-fill-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }
        
        .mobile-device .mobile-fill-btn {
            padding: 0.75rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--background);
            color: var(--foreground);
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.9rem;
        }
        
        .mobile-device .mobile-fill-btn:hover,
        .mobile-device .mobile-fill-btn.active {
            border-color: var(--primary);
            background-color: var(--primary);
            color: var(--primary-foreground);
        }
        
        /* 모바일 디버그 패널 */
        .mobile-device .mobile-debug-panel {
            position: fixed;
            top: 70px;
            left: 10px;
            right: 10px;
            background-color: rgba(0, 0, 0, 0.95);
            border-radius: 12px;
            padding: 1rem;
            z-index: 200;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
            max-height: 50vh;
            overflow-y: auto;
        }
        
        .mobile-device .mobile-debug-panel.show {
            display: block !important;
        }

        /* Hide elements initially if no image */
        .canvas-container.empty {
            background: transparent;
            box-shadow: none;
            padding: 2rem;
            text-align: center;
        }

        .empty-state {
            color: var(--muted-foreground);
            font-size: 1.125rem;
        }

        .empty-state .material-icons {
            font-size: 3rem;
            opacity: 0.5;
            margin-bottom: 1rem;
        }
