/* Typography */
.h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.h2 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.h3 {
  font-size: 1.875rem;
  font-weight: 700;
}
.h4 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
@media (width >= 768px) {
  .h1 {
    font-size: 3rem;
  }
  .h2 {
    font-size: 2.25rem;
  }
}
/* Static HTML / Mosaic demos: shell only — prefer <%= render Ui::ButtonComponent %> in app views */
.demo-button,
.demo-button-lg,
.demo-button-sm,
.demo-button-xs {
  @apply font-medium text-sm inline-flex items-center justify-center border border-transparent rounded-lg leading-5 shadow-xs transition;
}
.demo-button {
  @apply px-3 py-2;
}
.demo-button-lg {
  @apply px-4 py-3;
}
.demo-button-sm {
  @apply px-2 py-1;
}
.demo-button-xs {
  @apply px-2 py-0.5;
}

/* Token-based primary CTA (optional utility — prefer Ui::ButtonComponent) */
.semantic-primary {
  @apply font-medium text-sm inline-flex items-center justify-center border border-transparent rounded-lg leading-5 shadow-xs transition px-3 py-2;
  @apply bg-primary text-primary-foreground hover:bg-primary/90;
}

input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.ui-field,
.ui-checkbox,
.ui-radio {
  @apply bg-white dark:bg-gray-900/30 border focus:ring-0 focus:ring-offset-0 dark:disabled:bg-gray-700/30 dark:disabled:border-gray-700 dark:disabled:hover:border-gray-700;
}

.ui-checkbox {
  @apply rounded-sm;
}

.ui-field {
  @apply text-sm text-gray-800 dark:text-gray-100 leading-5 py-2 px-3 border-gray-200 hover:border-gray-300 focus:border-gray-300 dark:border-gray-700/60 dark:hover:border-gray-600 dark:focus:border-gray-600 shadow-xs rounded-lg;
  @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background;
  @apply placeholder-gray-400 dark:placeholder-gray-500;
}

select.ui-field {
  @apply pr-10;
}

.ui-checkbox,
.ui-radio {
  @apply text-primary checked:bg-primary checked:border-transparent border border-gray-300 dark:border-gray-700/60 dark:checked:border-transparent focus-visible:ring-2 focus-visible:ring-ring/50;
}

.ui-switch {
  @apply relative select-none;
  width: 44px;
}
.ui-switch label {
  @apply block overflow-hidden cursor-pointer h-6 rounded-full;
}
.ui-switch label > span:first-child {
  @apply absolute block rounded-full;
  width: 20px;
  height: 20px;
  top: 2px;
  left: 2px;
  right: 50%;
  transition: all 0.15s ease-out;
}
.ui-switch input[type='checkbox'] + label {
  @apply bg-gray-400 dark:bg-gray-700;
}
.ui-switch input[type='checkbox']:checked + label {
  @apply bg-primary;
}
.ui-switch input[type='checkbox']:checked + label > span:first-child {
  left: 22px;
}
.ui-switch input[type='checkbox']:disabled + label {
  @apply cursor-not-allowed bg-gray-100 dark:bg-gray-700/20 border border-gray-200 dark:border-gray-700/60;
}
.ui-switch input[type='checkbox']:disabled + label > span:first-child {
  @apply bg-gray-400 dark:bg-gray-600;
} /* Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Header theme toggle: explicit html.dark / :not(.dark) so sun/moon never share a flex row (avoids moon drifting ~8px). */
.theme-toggle-header__slot {
  align-items: center;
  justify-content: center;
}
html:not(.dark) .theme-toggle-header__slot--sun {
  display: inline-flex;
}
html.dark .theme-toggle-header__slot--sun {
  display: none !important;
}
html:not(.dark) .theme-toggle-header__slot--moon {
  display: none;
}
html.dark .theme-toggle-header__slot--moon {
  display: inline-flex;
}
.theme-toggle-header__slot iconify-icon {
  display: block;
}

/*
 * Square metric wells (dashboard cards, etc.):
 * ViewComponent injects HTML comments / whitespace before <iconify-icon>, which become extra grid/flex
 * items and shove the glyph to the top-left. Absolute centering ignores those nodes.
 * `font-size: 0` on the well collapses stray text struts; restore on the icon for 1em SVG math inside Iconify.
 */
.ui-stat-icon-well {
  position: relative;
  line-height: 0;
  font-size: 0;
}
.ui-stat-icon-well iconify-icon,
.ui-stat-icon-well > svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  font-size: 1rem;
  line-height: 0;
}
