* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

html {
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  background-color: #f3f2f8;
  text-rendering: optimizeLegibility !important;
  font-family: Inter, sans-serif;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  font-feature-settings: 'liga';
  font-synthesis: none !important;
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -moz-font-feature-settings: "kern" !important;
  font-feature-settings: "kern" !important;
  font-feature-settings: 'liga';
  scroll-behavior: smooth;
  -webkit-print-color-adjust: exact;
  color-adjust: exact;
  print-color-adjust: exact;
  margin: 0;
  padding: 0;
}

span {
  display: inline;
}

textarea {
  field-sizing: content;
  &::-webkit-scrollbar {
    display: none;
  }
  -ms-overflow-style: none;
  scrollbar-width: none;
  min-height: 16px;
}

#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.apg-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.apg-page main {
  flex: 1;
}

iframe {
  height: 100%;
  width: 100%;
  border: 0;
  display: block
}

iconify-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
}

iconify-icon:has(+ p) {
  margin-inline-end: calc(var(--spacing) * 2);
}

.icon-xs { font-size: 16px; }
.icon-sm { font-size: 20px; }
.icon-md { font-size: 24px; }
.icon-lg { font-size: 28px; }
.icon-xl { font-size: 33px; }
.icon-2xl { font-size: 48px; }

.txt {
  white-space: wrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-nowrap {
  width: max-content;
}

.menu-nowrap li,
.menu-nowrap li a {
  white-space: nowrap;
}

/* Webkit scrollbars for Safari/Chrome */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: none;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

::-webkit-scrollbar-thumb:active {
  background: rgba(0, 0, 0, 0.6);
}

/* Hide scrollbar corner */
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* For dark mode compatibility */
@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
  }

  ::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.6);
  }

  * {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
}

/* Optional: Hide scrollbars on mobile (like Safari does) */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    display: none;
  }
}

.custom-list {
  list-style-type: disc;
  list-style-position: inside;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-list p {
  display: inline-block;
  margin: 0;
  width: auto;
}

.custom-list > * + * {
  margin-top: 0.5rem;
}
