        :root {
            --bg-primary: #f8fafc;
            --bg-surface: #ffffff;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent: #2563eb;
            --accent-light: rgba(37, 99, 235, 0.08);
            --border-color: #e2e8f0;
            --radius: 12px;
            --global-transition: background-color 0.3s ease, color 0.3s ease;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --logo-grad: linear-gradient(135deg, #2563eb, #3b82f6);
        }

        body.dark-theme {
            --bg-primary: #0b0f19;
            --bg-surface: #131b2e;
            --text-main: #f1f5f9;
            --text-muted: #cbd5e1;
            --border-color: #1e293b;
            --accent-light: rgba(59, 130, 246, 0.15);
            --accent: #3b82f6;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
            --logo-grad: linear-gradient(135deg, #3b82f6, #60a5fa);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-main);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            transition: var(--global-transition);
        }

        header {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-color);
            padding: 0.75rem 1.5rem;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: var(--shadow-sm);
        }

        .header-container {
            max-width: 1440px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo-brand {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            text-decoration: none;
            transition: transform 0.2s ease;
        }
        .logo-brand:hover { transform: scale(1.02); }

        .logo-icon-box {
            width: 32px;
            height: 32px;
            background: var(--logo-grad);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 0.95rem;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
        }

        .logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-main); }
        .logo-text span { font-weight: 400; color: var(--text-muted); margin-left: 0.1rem; }
        .logo-dot { display: inline-block; color: var(--accent); margin-left: 0.05rem; }

        .theme-toggle-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            padding: 0.4rem 0.6rem;
            border-radius: 8px;
            cursor: pointer;
            color: var(--text-main);
            transition: var(--global-transition);
        }

        .workspace-layout {
            max-width: 1440px;
            width: 100%;
            margin: 0 auto;
            padding: 2rem 1.5rem;
            display: grid;
            grid-template-columns: 1fr 400px;
            gap: 2rem;
            align-items: start;
        }

        .workspace-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
            border-radius: var(--radius);
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .workspace-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 1rem;
        }

        .workspace-header .tool-icon {
            width: 40px;
            height: 40px;
            background: var(--accent-light);
            color: var(--accent);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .workspace-header h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
        .workspace-header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.15rem; }

        .form-group { display: flex; flex-direction: column; gap: 0.5rem; }
        .form-group label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
        
        .input-control {
            width: 100%;
            padding: 0.75rem 1rem;
            font-size: 0.95rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            background: var(--bg-primary);
            color: var(--text-main);
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .input-control:focus { border-color: var(--accent); background: var(--bg-surface); box-shadow: 0 0 0 3px var(--accent-light); }
        textarea.input-control { min-height: 120px; resize: vertical; }

        .select-control {
            width: 100%;
            padding: 0.75rem 1rem;
            font-size: 0.95rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            background: var(--bg-primary);
            color: var(--text-main);
            outline: none;
            cursor: pointer;
        }

        .options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

        .preview-pane {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 2rem;
            min-height: 300px;
            flex: 1;
        }

        .output-wrapper {
            background: #ffffff;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            display: flex;
            align-items: center;
            justify-content: center;
            max-width: 100%;
        }
        .output-wrapper canvas { max-width: 100%; height: auto !important; max-height: 100%; object-fit: contain; }

        .primary-action-btn {
            width: 100%;
            padding: 0.85rem;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-top: auto;
        }

        /* Documentation & Related Layout Components */
        .info-layout {
            max-width: 1440px;
            width: 100%;
            margin: 0 auto;
            padding: 0 1.5rem 3rem 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 2.5rem;
        }

        .divider {
            height: 1px;
            background: var(--border-color);
            width: 100%;
        }

        .info-section h2 {
            font-size: 1.25rem;
            font-weight: 800;
            margin-bottom: 1rem;
            letter-spacing: -0.02em;
        }

        .info-content {
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .info-content strong { color: var(--text-main); }

        .related-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }

        .tool-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
            border-radius: var(--radius);
            padding: 1.1rem;
            color: inherit;
            text-decoration: none;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
        }
        .tool-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
        .tool-icon-small { width: 36px; height: 36px; background: var(--accent-light); color: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
        .tool-card h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); }
        .tool-card p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.4; }

        .toast {
            position: fixed; bottom: 1.5rem; right: 1.5rem; background: #0f172a; color: white; padding: 0.75rem 1.2rem; border-radius: 8px; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; transform: translateY(150%); transition: transform 0.2s ease; z-index: 2000;
        }
        .toast.show { transform: translateY(0); }

        /* Modern Tablet and Desktop responsive optimization overrides */
        @media (max-width: 1024px) {
            .workspace-layout { grid-template-columns: 1fr 340px; gap: 1.25rem; padding: 1.5rem 1rem; }
        }

        @media (max-width: 900px) {
            .workspace-layout { grid-template-columns: 1fr; padding: 1rem 0.75rem; gap: 1rem; }
            .info-layout { padding: 0 0.75rem 2rem 0.75rem; gap: 1.5rem; }
            .preview-pane { min-height: 240px; }
        }