* {
    box-sizing: border-box;
}

:root {
    --bg: #c9dfe7;

    --surface: #e4eef2;
    --surface-soft: #d6e7ed;

    --chat-bg: #c1d9e2;
    --message-bg: #e8f1f4;

    --text: #102d3d;
    --text-secondary: #4d6875;
    --text-muted: #78909c;

    --border: rgba(16, 45, 61, 0.16);
    --input-border: #aec7d1;

    --accent: #1689c7;
    --accent-hover: #117db8;

    --danger: #c0392b;

    --home-glow: rgba(255, 255, 255, 0.25);
}

body.dark {
    --bg: #071923;
    --surface: #0d2633;
    --surface-soft: #102d3b;

    --chat-bg: #091f2b;
    --message-bg: #143443;

    --text: #e8f6fb;
    --text-secondary: #9bb6c2;
    --text-muted: #6f8d9a;

    --border: rgba(120, 190, 215, 0.12);
    --input-border: #254653;

    --accent: #249bd3;
    --accent-hover: #35a9dd;

    --danger: #ef7468;

    --home-glow: rgba(36, 155, 211, 0.08);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    background: var(--bg);
    color: var(--text);

    -webkit-font-smoothing: antialiased;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-loading {
    visibility: hidden;
}

body {
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;

    z-index: 2000;

    display: flex;
    flex-direction: column;
    gap: 10px;

    width: min(380px, calc(100vw - 40px));

    pointer-events: none;
}

.toast {
    position: relative;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px 42px 15px 16px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface);
    color: var(--text);

    box-shadow:
        0 12px 35px rgba(20, 70, 90, 0.15);

    font-size: 14px;
    line-height: 1.45;

    pointer-events: auto;

    animation:
        toast-in 0.25s ease forwards;
}

.toast--error {
    border-color: rgba(192, 57, 43, 0.25);
}

.toast--success {
    border-color: rgba(22, 137, 199, 0.25);
}

.toast__icon {
    flex: 0 0 auto;

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 12px;
    font-weight: 700;
}

.toast--error .toast__icon {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
}

.toast--success .toast__icon {
    background: rgba(22, 137, 199, 0.1);
    color: var(--accent);
}

.toast__message {
    padding-top: 1px;
}

.toast__close {
    position: absolute;
    top: 9px;
    right: 9px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--text-muted);

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}

.toast__close:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.toast--closing {
    animation:
        toast-out 0.25s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(25px);
    }
}

@media (max-width: 600px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;

        width: auto;
    }
}