/* Loaded before the app: shared palette prevents boot and hydration theme flashes. */
:root {
    --brand-foreground: #000;
    --brand-text: #000;
    --brand-accent: var(--primary, #24868f);
    --app-boot-background: #f4f5f5;
}
@media (prefers-color-scheme: dark) {
    :root:not(.light) {
        --brand-foreground: #e8eeee;
        --brand-text: #fff;
        --brand-accent: var(--primary, #31b8c4);
        --app-boot-background: #000;
    }
}
:root.dark {
    --brand-foreground: #e8eeee;
    --brand-text: #fff;
    --brand-accent: var(--primary, #31b8c4);
    --app-boot-background: #000;
}
html,
body {
    margin: 0;
    padding: 0;
    background: var(--app-boot-background);
}
#app-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    background: var(--app-boot-background);
}
/* The animated first frame has no ink; reduced motion starts fully settled. */
#app-boot-splash svg {
    width: min(360px, 82%);
    height: auto;
    visibility: hidden;
}
#app-boot-splash .native-boot-mark {
    display: none;
}
html[data-native-launch='true'] #app-boot-splash svg:not(.native-boot-mark) {
    display: none;
}
html[data-native-launch='true'] #app-boot-splash .native-boot-mark {
    display: block;
    visibility: visible;
    width: min(360px, 100%);
}
@media (prefers-reduced-motion: reduce) {
    #app-boot-splash svg {
        visibility: visible;
    }
    html[data-native-launch='true'] #app-boot-splash .native-boot-mark {
        display: none;
    }
    html[data-native-launch='true'] #app-boot-splash svg:not(.native-boot-mark) {
        display: block;
    }
}

/* Native launch screens use OS appearance. Crossfade only when a saved app
   override differs, independently of when hydration replaces the boot screen. */
:root {
    --native-launch-background: #f4f5f5;
}
@media (prefers-color-scheme: dark) {
    :root {
        --native-launch-background: #000;
    }
}
html[data-boot-appearance-mismatch='true']::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    pointer-events: none;
    background: var(--native-launch-background);
    animation: boot-appearance-handoff 180ms ease-out forwards;
}
@keyframes boot-appearance-handoff {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    html[data-boot-appearance-mismatch='true']::before {
        display: none;
    }
}
