*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:active:not(.toggle):not(.nav-item):not(.home-promo-dot):not(.onboarding-dot):not(.notif-tab):not(.history-filter-pill):not(.chip):not(.cards-color-option) {
  transform: scale(0.96);
  transition: transform 100ms ease;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:active {
  opacity: 0.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 12px; line-height: 1.4; }
.text-sm { font-size: 14px; line-height: 1.5; }
.text-base { font-size: 16px; line-height: 1.5; }
.text-lg { font-size: 18px; line-height: 1.4; }
.text-xl { font-size: 20px; line-height: 1.3; }
.text-2xl { font-size: 24px; line-height: 1.2; }
.text-3xl { font-size: 32px; line-height: 1.2; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: #FFFFFF; }
.text-blue { color: var(--primary); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-purple { color: var(--pending); }
.text-orange { color: var(--warning); }

.bg-surface { background-color: var(--surface); }
.bg-blue { background-color: var(--primary); }
.bg-blue-light { background-color: var(--primary-light); }
.bg-gray { background-color: var(--bg); }
.bg-green-light { background-color: var(--success-light); }
.bg-red-light { background-color: var(--danger-light); }
.bg-purple-light { background-color: var(--pending-light); }
.bg-orange-light { background-color: var(--warning-light); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }

.p-4 { padding: 4px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

.px-8 { padding-left: 8px; padding-right: 8px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }

.gap-x-4 { column-gap: 4px; }
.gap-x-8 { column-gap: 8px; }

.invisible { visibility: hidden; }
.visible { visibility: visible; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.touch-manipulation { touch-action: manipulation; }

@media (min-width: 640px) {
  html { font-size: 17px; }
  .sm\:px-24 { padding-left: 24px; padding-right: 24px; }
  .sm\:rounded-xl { border-radius: var(--radius-xl); }
}

@media (min-width: 768px) {
  html { font-size: 18px; }
  .md\:max-w-md { max-width: 28rem; }
  .md\:rounded-lg { border-radius: var(--radius-lg); }
  .md\:rounded-t-lg { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
}

@media (min-width: 1024px) {
  html { font-size: 16px; }
  #app {
    max-width: none;
    margin: 0;
    border: none;
    min-height: 100vh;
    min-height: 100dvh;
    box-shadow: none;
  }
  body {
    background-color: var(--bg);
  }
}

#app.admin-mode {
  max-width: none;
  margin: 0;
  border: none;
  box-shadow: none;
}
body.admin-body {
  background-color: var(--bg);
}

@media (orientation: landscape) and (max-height: 480px) {
  #app {
    min-height: 100vh;
    min-height: 100dvh;
  }
  .bottom-nav {
    height: 52px;
  }
  .app-container {
    padding-bottom: calc(52px + var(--safe-bottom));
  }
}
