:root {
    --color-bg: #f1f5f9;
    --color-bg-elevated: #ffffff;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-text-faint: #94a3b8;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-soft: #eff6ff;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-selection: #2563eb;
    --color-handle: #ffffff;
    --color-shadow: rgba(15, 23, 42, 0.12);

    --header-height: 56px;
    --tools-width: 88px;
    --props-width: 300px;
    --bottom-bar-height: 64px;
    --ad-height: 60px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    --font-body: 'Cairo', system-ui, -apple-system, "Segoe UI", Tahoma, Arial, "Noto Sans", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 10px 32px rgba(15, 23, 42, 0.16);
    --shadow-sheet: 0 -8px 30px rgba(15, 23, 42, 0.16);

    --transition-fast: 140ms ease;
    --transition-med: 220ms ease;

    --touch-min: 44px;
    --canvas-bg: #0b1220;
    --design-canvas-bg: #ffffff;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Dynamic layout values, kept in sync by JS (see main.js / InlineTextEditor).
       --kb-inset   : px of the visual viewport covered by the mobile keyboard
       --sheet-max  : bottom sheet height cap for the current viewport
       --sheet-h    : bottom sheet height actually reserved from the work area */
    --kb-inset: 0px;
    --sheet-max: 70vh;
    --sheet-h: 0px;
}

/* Dark theme: activated by <html data-theme="dark">. */
[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-elevated: #1e293b;
    --color-surface: #1e293b;
    --color-surface-muted: #162032;
    --color-border: #334155;
    --color-border-strong: #475569;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-faint: #64748b;
    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-primary-soft: #1e3a5f;
    --color-danger: #ef4444;
    --color-danger-hover: #f87171;
    --color-selection: #3b82f6;
    --color-handle: #f1f5f9;
    --color-shadow: rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.45);
    --shadow-sheet: 0 -8px 30px rgba(0, 0, 0, 0.45);

    --canvas-bg: #020617;
    --design-canvas-bg: #ffffff;
}
