/* === Base === */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}
.dark * {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

@media (max-width: 768px) {
    * { scrollbar-width: none; }
    *::-webkit-scrollbar { display: none; }
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* === Animations === */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.animate-pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

.fade-in { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Interactive === */
button, a, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* === Mobile-first === */
html, body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

input, select, textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
}

@media (min-width: 640px) {
    input, select, textarea {
        font-size: inherit;
    }
}

/* === Blazor === */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 0.5rem;
}
.blazor-error-boundary::after {
    content: "An error has occurred.";
}