html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 40%, #f1f5f9 100%);
  min-height: 100vh;
  min-height: 100dvh;
  color: #1e293b;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

.glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4338ca;
}

.mobile-nav-btn {
  color: #64748b;
  min-height: 56px;
  touch-action: manipulation;
}

.mobile-nav-btn.active {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.08);
}

.mobile-nav-btn.active span:last-child {
  font-weight: 700;
}

.mobile-nav-fab.active span:last-child {
  color: #4338ca;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.safe-top {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.safe-bottom {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.toast-mobile {
  top: max(1rem, calc(env(safe-area-inset-top) + 0.5rem));
}

.mobile-header {
  margin-top: calc(-1 * max(0px, env(safe-area-inset-top)));
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.touch-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.btn-primary {
  touch-action: manipulation;
  min-height: 48px;
}

.mobile-sheet-btn {
  touch-action: manipulation;
  min-height: 48px;
}

.mobile-sheet-btn:active {
  transform: scale(0.98);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 1.5rem;
}

input,
select,
textarea {
  color: #1e293b;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

@media (max-width: 767px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
  }

  textarea {
    min-height: 96px;
  }

  select {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .btn-primary:active {
    transform: scale(0.98);
  }

  #mobile-menu-sheet {
    animation: slideUp 0.25s ease-out;
  }

  #mobile-menu-overlay:not(.hidden) {
    animation: fadeOverlay 0.2s ease-out;
  }
}

.history-card {
  touch-action: manipulation;
}

.history-card:active {
  transform: scale(0.99);
}

.table-scroll {
  -webkit-overflow-scrolling: touch;
}

.table-scroll::-webkit-scrollbar {
  height: 6px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 3px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@media (min-width: 768px) {
  .sticky-mobile-submit {
    position: static;
  }
}
