/* ===== Design tokens ===== */

:root,
:root[data-theme="light"] {
    --bg: #F5F1EB;
    --surface: #FAF7F2;
    --surface-2: #EFEAE2;
    --text: #2D2A26;
    --text-muted: #7A736B;
    --border: #E8E2DA;
    --accent: #9B7B92;
    --accent-strong: #82647A;
    --accent-soft: #C9B5C2;
    --accent-bg: #EDE5EA;
    --shadow-sm: 0 1px 2px rgba(45, 42, 38, 0.05);
    --shadow-md: 0 1px 3px rgba(45, 42, 38, 0.06), 0 4px 12px rgba(45, 42, 38, 0.04);

    --tint-sage: #A8B5A0;
    --tint-apricot: #D4A88A;
    --tint-rose: #C9A0A8;
    --tint-clay: #B8967A;
}

:root[data-theme="dark"] {
    --bg: #1F1B17;
    --surface: #2A2622;
    --surface-2: #34302B;
    --text: #EDE8E0;
    --text-muted: #A09A92;
    --border: #3A342E;
    --accent: #B89BAF;
    --accent-strong: #D0B5C7;
    --accent-soft: #6B5466;
    --accent-bg: #3A2E37;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);

    --tint-sage: #889583;
    --tint-apricot: #B89476;
    --tint-rose: #B08891;
    --tint-clay: #9A7E68;
}

/* ===== Reset / base ===== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    overscroll-behavior-y: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

textarea, input { font-family: inherit; }

/* ===== Error UI (Blazor) ===== */

#blazor-error-ui {
    color-scheme: light only;
    background: #FCE9A8;
    color: #2D2A26;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #B8694D;
    padding: 0.75rem 1rem;
    color: white;
    border-radius: 8px;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "Something went wrong here.";
}
