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

        :root {
            --primary: #f8f9fa;
            --secondary: #e9ecef;
            --border: #dee2e6;
            --border-dark: #adb5bd;
            --text-primary: #212529;
            --text-secondary: #6c757d;
            --accent: #0d6efd;
            --accent-light: #b3e5fc;
            --aqua: #00bcd4;
            --aqua-dark: #0097a7;
            --success: #198754;
            --danger: #dc3545;
            --bg-white: #ffffff;
            --shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
            background: var(--primary);
            min-height: 100vh;
            color: var(--text-primary);
            font-size: 13px;
        }

        .app-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        /* Header */
        .header {
            background: var(--bg-white);
            border-bottom: 1px solid var(--border);
            padding: 12px 20px;
            box-shadow: var(--shadow);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            max-width: 1600px;
            margin: 0 auto;
        }

        .logo-section {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-icon {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, var(--aqua), var(--aqua-dark));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
        }

        .logo-icon::before {
            content: '';
            position: absolute;
            width: 35px;
            height: 35px;
            background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6) 20%, transparent 50%);
            border-radius: 50%;
        }

        .logo-icon::after {
            content: '💧';
            font-size: 24px;
            z-index: 2;
        }

        .logo-text h1 {
            font-size: 28px;
            font-weight: 800;
            color: var(--aqua);
            letter-spacing: 3px;
            margin: 0;
            line-height: 1;
            text-shadow: 0 1px 2px rgba(0, 188, 212, 0.2);
        }

        .logo-text .tagline {
            font-size: 11px;
            color: var(--aqua-dark);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-top: 3px;
            font-weight: 600;
        }

        .header-actions {
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        /* Buttons */
        .btn {
            padding: 8px 16px;
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            outline: none;
            background: var(--bg-white);
            color: var(--text-primary);
        }

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

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

        .btn-primary:hover {
            background: #0b5ed7;
            border-color: #0b5ed7;
        }

        .btn-success {
            background: #00bcd4;
            color: white;
            border-color: #00bcd4;
        }

        .btn-success:hover {
            background: #0097a7;
            border-color: #0097a7;
        }

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

        .btn-danger:hover {
            background: #bb2d3b;
            border-color: #bb2d3b;
        }

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

        .btn-sm {
            padding: 6px 12px;
            font-size: 11px;
        }

        .btn-large {
            padding: 14px 24px;
            font-size: 16px;
            font-weight: 700;
        }

        .btn-primary.btn-large {
            background: #00bcd4;
            color: white;
            border-color: #00bcd4;
        }

        .btn-primary.btn-large:hover {
            background: #0097a7;
            border-color: #0097a7;
        }

        .btn-customize {
            padding: 10px 18px;
            font-size: 14px;
            font-weight: 700;
        }

        /* File Upload */
        .file-upload {
            position: relative;
        }

        .file-upload input[type="file"] {
            display: none;
        }

        /* Dropdown Styles */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-toggle {
            background: var(--bg-white);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 10px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 140px;
            justify-content: space-between;
        }

        .dropdown-toggle:hover {
            background: var(--primary);
            border-color: var(--border-dark);
        }

        .dropdown-toggle.active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .dropdown-icon {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .dropdown-arrow {
            font-size: 10px;
            transition: transform 0.2s;
        }

        .dropdown.open .dropdown-arrow {
            transform: rotate(180deg);
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            z-index: 1000;
            min-width: 160px;
            display: none;
        }

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

        .dropdown-item {
            padding: 10px 14px;
            cursor: pointer;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            border-bottom: 1px solid var(--border);
        }

        .dropdown-item:last-child {
            border-bottom: none;
        }

        .dropdown-item:hover {
            background: var(--primary);
        }

        .dropdown-item.active {
            background: var(--accent-light);
            color: var(--accent);
        }

        .color-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            border: 1px solid rgba(0,0,0,0.2);
        }

        /* Toolbar */
        .toolbar {
            background: var(--secondary);
            border-bottom: 1px solid var(--border);
            padding: 8px 20px;
            min-height: 70px;
            display: flex;
            align-items: center;
        }

        .toolbar-content {
            display: flex;
            gap: 20px;
            align-items: center;
            flex-wrap: nowrap;
            max-width: 1600px;
            margin: 0 auto;
            width: 100%;
            overflow: visible;
        }

        .toolbar-section {
            display: flex;
            gap: 8px;
            align-items: center;
            padding: 4px 0;
        }

        .toolbar-divider {
            width: 1px;
            height: 30px;
            background: var(--border-dark);
            margin: 0 8px;
        }

        .toolbar-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-right: 8px;
            letter-spacing: 0.5px;
            min-width: 50px;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        /* Workspace */
        .workspace-container {
            flex: 1;
            padding: 12px;
            display: flex;
            flex-direction: column;
        }

        .workspace {
            flex: 1;
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: 6px;
            position: relative;
            overflow: hidden;
            min-height: 400px;
        }

        #canvas {
            position: absolute;
            top: 0;
            left: 0;
            cursor: crosshair;
            z-index: 10;
            width: 100%;
            height: 100%;
        }

        #backgroundImage {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .no-image {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: var(--text-secondary);
            pointer-events: none;
            z-index: 5;
        }

        .no-image-icon {
            width: 80px;
            height: 80px;
            background: var(--secondary);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            margin-bottom: 16px;
            color: var(--aqua);
        }

        .no-image h3 {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .no-image p {
            font-size: 14px;
        }

        /* Sidebar */
        .sidebar {
            width: 300px;
            background: var(--bg-white);
            border-left: 1px solid var(--border);
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            background: var(--secondary);
        }

        .sidebar-header h2 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

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

        .sidebar-section {
            margin-bottom: 32px;
        }

        .sidebar-section-title {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--text-primary);
            margin-bottom: 16px;
            letter-spacing: 0.8px;
        }

        /* Legend Grid */
        .legend-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }

        .legend-column h4 {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 16px;
            text-transform: uppercase;
            letter-spacing: 0.6px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-primary);
            font-weight: 500;
        }

        .legend-line {
            width: 28px;
            height: 4px;
            border-radius: 2px;
        }

        .legend-shape {
            width: 16px;
            height: 16px;
            background: var(--text-primary);
            border-radius: 2px;
        }

        .legend-shape.circle {
            border-radius: 50%;
        }

        /* Text Input */
        #textInput {
            background: var(--bg-white);
            padding: 10px;
            border-radius: 6px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.15);
            border: 1px solid var(--border);
            display: flex;
            gap: 6px;
            align-items: center;
        }

        #textField {
            padding: 6px 10px;
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 12px;
            outline: none;
            flex: 1;
        }

        #textField:focus {
            border-color: #00bcd4;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: var(--bg-white);
            border-radius: 8px;
            padding: 28px;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
            border: 1px solid var(--border);
        }

        .modal-header {
            margin-bottom: 24px;
        }

        .modal-header h2 {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 6px;
        }

        .modal-header p {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .color-setting-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 14px;
            padding: 14px;
            background: var(--primary);
            border-radius: 6px;
            border: 1px solid var(--border);
        }

        .color-setting-label {
            font-weight: 500;
            color: var(--text-primary);
            font-size: 12px;
        }

        .color-picker-large {
            width: 50px;
            height: 30px;
            border: 1px solid var(--border);
            border-radius: 4px;
            cursor: pointer;
            background: transparent;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 24px;
            padding-top: 20px;
            border-top: 1px solid var(--border);
        }

        /* Help text */
        .help-text {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .shortcut-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 11px;
        }

        .shortcut-key {
            background: var(--secondary);
            padding: 2px 6px;
            border-radius: 3px;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
            font-weight: 500;
            color: var(--text-primary);
            font-size: 10px;
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .sidebar {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                gap: 12px;
            }
            
            .toolbar-content {
                flex-direction: column;
                align-items: stretch;
            }
            
            .toolbar-section {
                flex-wrap: wrap;
            }
        }