:root {
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Tajawal", system-ui, sans-serif;
  overflow-x: hidden;
  max-width: 100%;
  min-height: 100dvh;
  padding-top: var(--safe-top);
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

button, a, input, select, textarea {
  max-width: 100%;
}

input, select, textarea {
  font-size: 16px;
}

.punch-pulse {
  animation: punchPulse 2.2s ease-in-out infinite;
}

@keyframes punchPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.45); }
  50% { box-shadow: 0 0 0 16px rgba(13, 148, 136, 0); }
}

.chat-bubble {
  max-width: min(85%, 36rem);
  word-break: break-word;
}

.leaflet-container {
  font-family: inherit;
  border-radius: 1rem;
  width: 100%;
}

.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.overflow-x-auto table {
  min-width: 40rem;
}

.nav-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar { display: none; }

#pwa-install-bar {
  padding-bottom: max(0.75rem, var(--safe-bottom));
}

body.has-pwa-bar main {
  padding-bottom: calc(6.75rem + var(--safe-bottom));
}

body.has-pwa-bar .login-wrap {
  padding-bottom: calc(7rem + var(--safe-bottom));
}

@media (max-width: 640px) {
  main h1 { font-size: 1.35rem !important; line-height: 1.35; }
  #map { height: 240px !important; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #map { height: 320px !important; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .print-card { box-shadow: none !important; border: 1px solid #ddd; }
  body.has-pwa-bar main { padding-bottom: 0; }
}
