body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

/* Custom subtle scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

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

/* Native dialog scroll containment & backdrop */
dialog:modal {
  overscroll-behavior: contain;
  max-height: 90dvh;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

/* Form controls: branding, accessible focus, and mobile tap sizing */
input[type="checkbox"],
input[type="radio"],
progress {
  accent-color: #4f46e5;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.compact-input),
select:not(.compact-input),
textarea:not(.compact-input) {
  font-size: max(1rem, 1em);
  min-height: 44px;
}

:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
}

/* Deferred validation styling: only after user interaction */
:is(:user-invalid, .user-invalid-fallback):not([type="checkbox"]):not([type="radio"]) {
  border-color: #e11d48 !important;
  background-color: #fff1f2;
}

/* Hides content visually while keeping it accessible to screen readers */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}
