:root {
  color-scheme: light;
  --ol-focus: #0f766e;
  --ol-focus-soft: rgba(13, 148, 136, .2);
}

html { scroll-behavior: smooth; }
body { letter-spacing: 0; }
[hidden] { display: none !important; }

.ui-skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 100;
  transform: translateY(-5rem);
  border-radius: .375rem;
  background: #0f172a;
  color: #fff;
  padding: .625rem 1rem;
  font-size: .875rem;
  font-weight: 700;
}
.ui-skip-link:focus { transform: translateY(0); }

[data-ui-shell] :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--ol-focus);
  outline-offset: 2px;
}
[data-ui-shell] :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  max-width: 100%;
}
[data-ui-shell] :where(input, select, textarea):disabled,
[data-ui-shell] :where(button):disabled {
  cursor: not-allowed;
  opacity: .65;
}
[data-ui-shell] label:has(+ :where(input, select, textarea)[required])::after,
[data-ui-shell] label:has(~ :where(input, select, textarea)[required])::after {
  content: " *";
  color: #b91c1c;
}
[data-ui-shell] :where(table) { width: 100%; }
[data-ui-shell] :where(th) { white-space: nowrap; }
[data-ui-shell] :where(tbody tr) { transition: background-color 120ms ease; }
[data-ui-shell] :where(summary) { user-select: none; }

.ui-toast-region {
  position: fixed;
  right: 1rem;
  top: 4.75rem;
  z-index: 60;
  display: grid;
  width: min(24rem, calc(100vw - 2rem));
  gap: .75rem;
  pointer-events: none;
}
.ui-toast { pointer-events: auto; box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.ui-toast.is-leaving { opacity: 0; transform: translateY(-.5rem); transition: opacity 150ms ease, transform 150ms ease; }

.ui-status { display: inline-flex; align-items: center; gap: .35rem; border-radius: .375rem; padding: .25rem .5rem; font-size: .75rem; font-weight: 700; box-shadow: inset 0 0 0 1px currentColor; }
.ui-scope { display: inline-flex; align-items: center; border-radius: .25rem; background: #f1f5f9; padding: .2rem .45rem; color: #475569; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.ui-empty { border: 1px dashed #cbd5e1; border-radius: .5rem; background: #f8fafc; padding: 2rem 1rem; text-align: center; color: #64748b; }
.ui-field-error { margin-top: .35rem; color: #b91c1c; font-size: .75rem; font-weight: 600; }
.ui-help { margin-top: .35rem; color: #64748b; font-size: .75rem; line-height: 1.25rem; }
.ui-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }

[data-admin-sidebar] nav { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
[data-admin-sidebar] [aria-current="page"] { position: relative; }
[data-admin-sidebar]:not(.is-compact) [aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  bottom: .45rem;
  width: 3px;
  border-radius: 999px;
  background: #2dd4bf;
}

@media (max-width: 639px) {
  [data-ui-shell] :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px !important; }
  [data-ui-shell] :where(button, a)[class*="px-"] { min-height: 2.5rem; }
  .ui-toast-region { left: .75rem; right: .75rem; top: .75rem; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .ui-toast-region, [data-ui-no-print] { display: none !important; }
}
