/* Mist Day theme tokens. Components should consume these variables instead of raw colors. */
html[data-ui-theme="mist-day"] {
    color-scheme: only light;
    --ui-canvas: #ece5d6;
    --ui-surface: #e8e1d1;
    --ui-surface-subtle: #f0eadc;
    --ui-surface-sunken: #e3dbc9;
    --ui-surface-raised: #f3eee3;
    --ui-border: #c6bca6;
    --ui-border-strong: #a79c84;
    --ui-text: #1f1c17;
    --ui-text-secondary: #55504a;
    --ui-text-muted: #8c8577;
    --ui-brand: #26221b;
    --ui-brand-hover: #0c0a07;
    --ui-brand-soft: #ddd4c0;
    --ui-brand-strong: #1c1812;
    --ui-info: #6f6759;
    --ui-success: #47423a;
    --ui-warning: #9a6700;
    --ui-danger: #8c3a2b;
    --ui-danger-soft: #f1ddd5;
    --ui-warning-soft: #eee2c8;
    --ui-success-soft: #dedbd2;
    --ui-info-soft: #e3dbc9;
    --ui-overlay: rgba(20, 17, 13, 0.55);
    --ui-focus-ring: rgba(20, 17, 13, 0.12);
    --ui-shadow-sm: 0 1px 2px rgba(40, 34, 24, 0.08);
    --ui-shadow-md: 0 8px 24px rgba(40, 34, 24, 0.12);
    --ui-shadow-lg: 0 10px 30px rgba(40, 34, 24, 0.2);
    --ui-paper-texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/></svg>");
    --ui-radius-sm: 6px;
    --ui-radius-md: 8px;
    --ui-radius-lg: 12px;
    --ui-duration-fast: 140ms;
    --ui-duration-normal: 220ms;
    --ui-ease-standard: cubic-bezier(0.2, 0.65, 0.25, 1);

    /* DaisyUI v4 bridge values (OKLCH channels, as required by DaisyUI 4.x). */
    --b1: 0.9322 0.0144 84.58;
    --b2: 0.9051 0.0215 85.95;
    --b3: 0.8576 0.0227 80.68;
    --bc: 0.2323 0.0104 80.59;
    --p: 0.2570 0.0134 87.57;
    --pf: 0.1509 0.0073 79.09;
    --pc: 0.9264 0.0173 84.59;
    --s: 0.5449 0.0327 77.29;
    --sf: 0.4527 0.0308 76.40;
    --sc: 0.9264 0.0173 84.59;
    --a: 0.7265 0.1504 72.70;
    --af: 0.6543 0.1361 72.86;
    --ac: 0.9264 0.0173 84.59;
    --n: 0.2788 0.0138 81.68;
    --nf: 0.1509 0.0073 79.09;
    --nc: 0.9264 0.0173 84.59;
    --in: 0.6255 0.1866 259.69;
    --inc: 1.0000 0.0000 89.88;
    --su: 0.6196 0.1367 157.77;
    --suc: 1.0000 0.0000 89.88;
    --wa: 0.5777 0.1200 70.04;
    --wac: 1.0000 0.0000 89.88;
    --er: 0.5073 0.1914 27.54;
    --erc: 1.0000 0.0000 89.88;
    --rounded-box: 0.5rem;
    --rounded-btn: 0.5rem;
    --rounded-badge: 0.375rem;
    --animation-btn: 0;
    --animation-input: 0;
    --btn-text-case: none;
    --btn-focus-scale: 0.98;
}

html[data-ui-theme="mist-day"],
html[data-ui-theme="mist-day"] body {
    background: var(--ui-canvas);
    color: var(--ui-text);
    color-scheme: only light;
}

html[data-ui-theme="mist-day"] body {
    background: var(--ui-paper-texture), radial-gradient(1100px 520px at 82% -12%, rgba(20, 17, 13, 0.1), transparent 60%), radial-gradient(820px 460px at -6% 112%, rgba(20, 17, 13, 0.08), transparent 58%), var(--ui-canvas);
    background-attachment: fixed;
    font-family: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
    accent-color: var(--ui-brand);
}

html[data-ui-theme="mist-day"] ::selection {
    color: #ffffff;
    background: var(--ui-brand);
}

html[data-ui-theme="mist-day"] :focus-visible {
    outline: 2px solid var(--ui-brand);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

html[data-ui-theme="mist-day"] input,
html[data-ui-theme="mist-day"] textarea,
html[data-ui-theme="mist-day"] select,
html[data-ui-theme="mist-day"] button {
    font-family: inherit;
}

/* Future themes register another html[data-ui-theme="..."] token block here.
   Components intentionally consume only --ui-* variables. */

/* Night (dark) theme — parchment dark palette. */
html[data-ui-theme="night"] {
    color-scheme: dark;
    --ui-canvas: #1c1a17;
    --ui-surface: #26221b;
    --ui-surface-subtle: #2e2a22;
    --ui-surface-sunken: #16140f;
    --ui-surface-raised: #2e2a22;
    --ui-border: #3a352c;
    --ui-border-strong: #4a4338;
    --ui-text: #ece5d6;
    --ui-text-secondary: #b5ad9e;
    --ui-text-muted: #8c8577;
    --ui-brand: #c97b5a;
    --ui-brand-hover: #d88a6a;
    --ui-brand-soft: #3a2a22;
    --ui-brand-strong: #e8ddc8;
    --ui-info: #9aa3b0;
    --ui-success: #7a9a78;
    --ui-warning: #c69a4a;
    --ui-danger: #c97b5a;
    --ui-danger-soft: #3a2a22;
    --ui-warning-soft: #38321a;
    --ui-success-soft: #243024;
    --ui-info-soft: #2a2e36;
    --ui-overlay: rgba(0, 0, 0, 0.66);
    --ui-focus-ring: rgba(201, 123, 90, 0.3);
    --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ui-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --ui-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
    --ui-paper-texture: none;
    --ui-radius-sm: 6px;
    --ui-radius-md: 8px;
    --ui-radius-lg: 12px;
    --ui-duration-fast: 140ms;
    --ui-duration-normal: 220ms;
    --ui-ease-standard: cubic-bezier(0.2, 0.65, 0.25, 1);
    --b1: 0.2189 0.0065 78.18;
    --b2: 0.2540 0.0140 81.64;
    --b3: 0.2866 0.0152 84.55;
    --bc: 0.9233 0.0214 85.95;
    --p: 0.6590 0.1082 43.44;
    --pf: 0.5980 0.1057 42.26;
    --pc: 0.1929 0.0410 21.63;
    --s: 0.6163 0.0227 81.74;
    --sf: 0.5431 0.0258 78.06;
    --sc: 0.9233 0.0214 85.95;
    --a: 0.6590 0.1082 43.44;
    --af: 0.5980 0.1057 42.26;
    --ac: 0.1929 0.0410 21.63;
    --n: 0.2540 0.0140 81.64;
    --nf: 0.2189 0.0065 78.18;
    --nc: 0.9233 0.0214 85.95;
    --in: 0.7124 0.0215 257.49;
    --inc: 0.2189 0.0065 78.18;
    --su: 0.6524 0.0612 143.33;
    --suc: 0.2189 0.0065 78.18;
    --wa: 0.7117 0.1109 80.28;
    --wac: 0.2189 0.0065 78.18;
    --er: 0.6590 0.1082 43.44;
    --erc: 0.9233 0.0214 85.95;
    --rounded-box: 0.5rem;
    --rounded-btn: 0.5rem;
    --rounded-badge: 0.375rem;
    --animation-btn: 0;
    --animation-input: 0;
    --btn-text-case: none;
    --btn-focus-scale: 0.98;
}

html[data-ui-theme="night"],
html[data-ui-theme="night"] body {
    background: var(--ui-canvas);
    color: var(--ui-text);
    color-scheme: dark;
}

html[data-ui-theme="night"] body {
    background:
        radial-gradient(1100px 520px at 82% -12%, rgba(74, 58, 42, 0.18), transparent 60%),
        radial-gradient(820px 460px at -6% 112%, rgba(46, 58, 74, 0.16), transparent 58%),
        var(--ui-canvas);
    background-attachment: fixed;
    font-family: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
    accent-color: var(--ui-brand);
}

html[data-ui-theme="night"] ::selection {
    color: #ffffff;
    background: var(--ui-brand);
}

html[data-ui-theme="night"] :focus-visible {
    outline: 2px solid var(--ui-brand);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

html[data-ui-theme="night"] input,
html[data-ui-theme="night"] textarea,
html[data-ui-theme="night"] select,
html[data-ui-theme="night"] button {
    font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
    html[data-ui-theme="mist-day"] *,
    html[data-ui-theme="mist-day"] *::before,
    html[data-ui-theme="mist-day"] *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
