:root {
    /* --- COLOR PALETTE (Constants) --- */
    --clr-orange-500: #f97316;
    --clr-orange-600: #ea580c;
    --clr-green-500: #34C759;
    --clr-red-500: #ff0000;
    --clr-white: #ffffff;
    --clr-black: #000000;

    /* --- DESIGN SYSTEM TOKENS (Light Theme - Default) --- */
    --surface-primary: #FAF6F3;
    --surface-secondary: #ffffff;
    --surface-tertiary: #F0F9EB;
    --surface-modal: #FFFFFF;
    --surface-bubble: #F3F4F6;
    --surface-overlay: rgba(0, 0, 0, 0.4);


    --text-main: #1F2937;
    --text-muted: #6B7280;
    --text-contrast: #FFFFFF;
    --text-accent: var(--clr-orange-600);

    --border-main: #E5E7EB;
    --border-subtle: rgba(0, 0, 0, 0.05);

    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-full: 9999px;
    --radius-lg: 12px;
    --radius-xl: 20px;

    /* --- COMPONENT TOKENS --- */
    --btn-primary-bg: linear-gradient(to right, #f6954b, #f9c59d, #f8aa9a);
    --btn-primary-text: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* --- DESIGN SYSTEM TOKENS (Dark Theme) --- */
        --surface-primary: #000000;
        --surface-secondary: #121212;
        --surface-tertiary: #1A1A1A;
        --surface-modal: #121212;
        --surface-bubble: #1E1E1E;
        --surface-overlay: rgba(0, 0, 0, 0.7);

        --text-main: #F3F4F6;
        --text-muted: #9CA3AF;
        --text-contrast: #FFFFFF;
        --text-accent: var(--clr-orange-500);

        --border-main: #2D2D2D;
        --border-subtle: rgba(255, 255, 255, 0.1);

        --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

/* Backward compatibility map (to avoid breaking other files immediately) */
:root {
    --bg-primary: var(--surface-primary);
    --bg-card: var(--surface-secondary);
    --bg-header: var(--surface-primary);
    --bg-bubble: var(--surface-bubble);
    --bg-modal-content: var(--surface-modal);
    --bg-overlay: var(--surface-overlay);
    --bg-popup: var(--surface-secondary);

    --text-primary: var(--text-main);
    --text-secondary: var(--text-main);
    --text-on-overlay: var(--text-contrast);

    --border-color: var(--border-main);
    --tab-bg: var(--surface-tertiary);
    --tab-active-bg: var(--surface-primary);
    --orange-600: var(--text-accent);
}

/* --- UTILITIES --- */
.text-accent {
    color: var(--text-accent) !important;
}

.bg-primary {
    background-color: var(--surface-primary) !important;
}

.bg-secondary {
    background-color: var(--surface-secondary) !important;
}

/* Custom Button Colors (Examples) */
.btn-green {
    --btn-primary-bg: var(--clr-green-500);
    --btn-primary-text: white;
}

.btn-red {
    --btn-primary-bg: var(--clr-red-500);
    --btn-primary-text: white;
}

.btn-blue {
    --btn-primary-bg: #007AFF;
    --btn-primary-text: white;
}

.btn-orange {
    --btn-primary-bg: var(--clr-orange-600);
    --btn-primary-text: white;
}

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

body {
    font-family: "Inter", -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utilities */
.p-0 {
    padding: 0 !important;
}

.px-16 {
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.pt-20 {
    padding-top: 20px !important;
}

.pb-15 {
    padding-bottom: 15px !important;
}

.mt-neg-50 {
    margin-top: -50px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

.mb-10 {
    margin-bottom: 10px !important;
}

.m-0 {
    margin: 0 !important;
}

.relative {
    position: relative !important;
}

.z-10 {
    z-index: 10 !important;
}

.z-max {
    z-index: 1000 !important;
}

.w-100 {
    width: 100% !important;
}

.w-full {
    width: 100% !important;
}

.h-full {
    height: 100% !important;
}

.aspect-square {
    aspect-ratio: 1 / 1 !important;
}

.text-center {
    text-align: center !important;
}

.font-bold {
    font-weight: 700 !important;
}

.text-lg {
    font-size: 20px !important;
}

.line-height-base {
    line-height: 1.4 !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-full {
    border-radius: var(--radius-full) !important;
}

.block {
    display: block !important;
}

.inline-block {
    display: inline-block !important;
}

.flex {
    display: flex !important;
}

.align-end {
    align-items: flex-end !important;
}

.justify-between {
    justify-content: space-between !important;
}

.hidden {
    display: none !important;
}