 /* --- Design Tokens & Variables (From main.css) --- */
        :root {
            --main-color: #1A48EE;
            --secondary-color: #008AFF;
            --tertiary-color: #2c20E6;
            --secondary-background: #f9f9f9;
            --main-background: #e5f3ff;
            --tertiary-background: #e6e5ea;
            --color-white: #ffffff;
            --color-error-dark: #c53030;
            --color-green: #16a34a;
            --color-green-dark: #047857;
            --color-light-green: #D1FAE5;
            --color-contrast-green: #065F46;
            --border-color: #e2e8f0;
            --color-gray: #4a5568;
            --color-light-gray: #ccc;
            --color-very-light-gray: #e0e0e0;
        }

        /* --- Global Resets & Typography --- */
        * {
            box-sizing: border-box;  
        }

        body { 
            font-family: Arial, Helvetica, sans-serif;
            background-color: var(--main-background);
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 100vh;
            color: #1a202c;
            line-height: 1.6;
            margin: 0;
        }

        h1, h2, h3, h4 {
            color: var(--main-color);
        }
        
        h1 {
            width: 100%;
            display: inline-block;
            text-align: center;
            margin-top: 0px;
            color: #1a202c;
            font-size: 2.25rem;
            margin-bottom: 0.5rem;
            letter-spacing: -0.025em;
        }

        p {
            margin-top: 0;
            margin-bottom: 16px;
        }
        b, strong { font-weight: bold; }

        /* --- Layout & Containers --- */
        .tool-container { 
            width: 100%; 
            max-width: 900px; 
            margin: 0 auto;
        }

        .page-intro { 
            text-align: center; 
            margin-bottom: 2rem; 
        }
        
        .page-intro p { 
            color: var(--color-gray); 
            font-size: 1.1rem; 
        }

        /* --- Shared UI Components --- */
        .card {
            background-color: var(--color-white);
            border-radius: 8px;
            border: 1px solid var(--border-color);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
            padding: 2rem;
            margin-bottom: 2rem;
            margin-top: 0.5rem;
            width: 100%;
        }

        label {
            display: block;
            font-size: 0.875rem;
            font-weight: bold;
            color: var(--color-gray);
            margin-bottom: 0.5rem;
        }

        input[type="range"], 
        select {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid #cbd5e0;
            border-radius: 0.375rem;
            box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            font-size: 1rem;
            font-family: Arial, Helvetica, sans-serif;
            background-color: var(--color-white);
            color: inherit;
        }

        input:focus, select:focus {
            outline: none;
            border-color: var(--main-color);
            box-shadow: 0 0 0 3px rgba(26, 72, 238, 0.4);
        }

        .btn {
            background-color: var(--main-color);
            color: var(--color-white);
            font-weight: bold;
            padding: 0.75rem 2rem;
            border: none;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s, transform 0.2s;
            cursor: pointer;
            font-size: 1rem;
            text-align: center;
            text-decoration: none;
            display: block;
            width: 100%;
        }

        .btn:hover:not(:disabled) {
            background-color: var(--secondary-color);
            transform: translateY(-1px);
        }
        
        .btn:disabled, .btn[aria-disabled="true"] { 
            background: var(--color-light-gray); 
            cursor: not-allowed; 
            opacity: 0.7; 
            box-shadow: none;
            transform: none;
        }

        .btn-success { background-color: var(--color-green); display: none; }
        .btn-success:hover { background-color: var(--color-green-dark); }

        .disclaimer {
            background-color: #fffbe6;
            border: 1px solid #ffe58f;
            padding: 15px;
            border-radius: 5px;
            margin: 25px 0 0 0;
            font-size: 14px;
            color: var(--color-gray);
            text-align: center;
            line-height: 1.5;
        }

        .privacy-note {
            background-color: var(--main-background);
            border: 1px solid var(--secondary-color);
            color: var(--main-color);
            padding: 15px;
            border-radius: 5px;
            margin: 25px 0 0 0;
            font-size: 0.95rem;
            text-align: center;
            line-height: 1.5;
        }

        /* --- App Specific UI --- */
        .drop-zone {
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            padding: 3rem 1.5rem; 
            text-align: center;
            cursor: pointer; 
            transition: all 0.2s ease;
            position: relative; 
            background: var(--secondary-background);
        }

        /* Accessibility: Visual focus indicator when hidden input is focused via keyboard */
        .drop-zone:focus-within,
        .drop-zone:hover, 
        .drop-zone.dragging {
            border-color: var(--main-color);
            background: var(--main-background);
        }
        
        .drop-zone:focus-within {
            box-shadow: 0 0 0 3px rgba(26, 72, 238, 0.4);
            outline: none;
        }

        .drop-zone input {
            position: absolute; inset: 0;
            width: 100%; height: 100%;
            opacity: 0; cursor: pointer;
        }

        .icon-large { font-size: 3.5rem; margin-bottom: 1rem; display: block; }

        .grid-layout {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            margin-top: 2rem;
        }

        @media (max-width: 768px) {
            .grid-layout { grid-template-columns: 1fr; }
        }

        .panel-title {
            font-size: 0.9rem;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--color-gray);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.5rem;
        }

        .settings-box { display: flex; flex-direction: column; gap: 1.25rem; }

        .range-info {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--color-gray);
            margin-top: 0.25rem;
            font-weight: normal;
        }

        .preview-wrapper {
            background: var(--tertiary-background);
            background-image: 
                linear-gradient(45deg, var(--color-very-light-gray) 25%, transparent 25%), 
                linear-gradient(-45deg, var(--color-very-light-gray) 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, var(--color-very-light-gray) 75%), 
                linear-gradient(-45deg, transparent 75%, var(--color-very-light-gray) 75%);
            background-size: 20px 20px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            min-height: 250px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        #img-preview { max-width: 100%; max-height: 400px; object-fit: contain; display: none; }

        .placeholder-text { color: var(--color-gray); text-align: center; padding: 1rem; font-style: italic; }

        .actions { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }

        .status-banner {
            margin-top: 1rem;
            padding: 1rem;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: bold;
            display: none;
            border: 1px solid transparent;
            animation: fadeIn 0.3s ease-out;
        }

        .status-info { 
            background: var(--color-light-green); 
            color: var(--color-contrast-green); 
            border-color: var(--color-green); 
        }
        
        .status-error { 
            background: #fee2e2; 
            color: var(--color-error-dark); 
            border-color: var(--color-error-dark); 
        }

        .file-meta { 
            margin-top: 0.5rem; 
            font-size: 0.8rem; 
            color: var(--color-gray); 
            text-align: center; 
        }

        .loader {
            border: 3px solid #f3f3f3;
            border-top: 3px solid var(--main-color);
            border-radius: 50%;
            width: 24px;
            height: 24px;
            animation: spin 1s linear infinite;
            display: inline-block;
            vertical-align: middle;
            margin-right: 8px;
        }
        
        /* Visually hide element but keep accessible to screen readers */
        .sr-only {
            position: absolute;
            width: 1px; height: 1px;
            padding: 0; margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border-width: 0;
        }

        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .hidden { display: none !important; }