:root {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Viewport height fix for mobile Edge/Yandex */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hide { display: none !important; }

/* ======================== */
/*  CRITICAL LAYOUT FALLBACK  */
/* ======================== */

/* App layout */
#app-layout {
  display: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
}
#app-layout:not(.hide) {
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  #app-layout:not(.hide) { flex-direction: row; }
}

/* Auth view */
#auth-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

/* Content area */
#content-area {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Mobile bottom nav safe area */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Form elements base */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select {
  width: 100%;
  box-sizing: border-box;
}

/* Modal base */
[id^="modal-"] {
  position: fixed;
  inset: 0;
  z-index: 50;
}

/* Nav active state */
.nav-active {
  background-color: #e0e7ff;
  color: #4338ca;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-available { background-color: #dcfce7; color: #166534; }
.status-in_use { background-color: #fef08a; color: #854d0e; }
.status-maintenance { background-color: #fee2e2; color: #991b1b; }
.status-active { background-color: #dbeafe; color: #1e40af; }
.status-completed { background-color: #f3f4f6; color: #374151; }
.status-cancelled { background-color: #fee2e2; color: #991b1b; }

/* Hide Leaflet attribution */
.leaflet-control-attribution { display: none !important; }

/* ======================== */
/*  TAILWIND UTILITY FALLBACKS  */
/* (applies only when CDN fails)  */
/* ======================== */

/* --- Box Sizing Reset --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Display --- */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }

/* --- Flex --- */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.grow { flex-grow: 1; }

/* --- Grid --- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --- Position --- */
.static { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* --- Inset / Position offsets --- */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.top-1\.5 { top: 0.375rem; }
.top-4 { top: 1rem; }
.right-0 { right: 0; }
.right-4 { right: 1rem; }
.bottom-0 { bottom: 0; }
.bottom-4 { bottom: 1rem; }
.bottom-20 { bottom: 5rem; }
.left-0 { left: 0; }
.left-4 { left: 1rem; }

/* --- Z-Index --- */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[9999\] { z-index: 9999; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.overflow-x-auto { overflow-x: auto; }
.overflow-visible { overflow: visible; }

/* --- Sizing: Width --- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-1 { width: 0.25rem; }
.w-1\.5 { width: 0.375rem; }
.w-2 { width: 0.5rem; }
.w-2\.5 { width: 0.625rem; }
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-64 { width: 16rem; }
.w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-max { width: max-content; }
.min-w-0 { min-width: 0; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

/* --- Sizing: Height --- */
.h-full { height: 100%; }
.h-screen { height: 100vh; height: 100dvh; }
.h-auto { height: auto; }
.h-1 { height: 0.25rem; }
.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-64 { height: 16rem; }
.h-80 { height: 20rem; }
.min-h-0 { min-height: 0; }

/* --- Max height --- */
.max-h-\[30vh\] { max-height: 30vh; }
.max-h-\[600px\] { max-height: 600px; }
.max-h-\[80vh\] { max-height: 80vh; }
.max-h-\[90vh\] { max-height: 90vh; }
.h-\[70vh\] { height: 70vh; }
.h-\[85vh\] { height: 85vh; }

/* --- Min height --- */
.min-h-\[46px\] { min-height: 46px; }
.min-h-\[200px\] { min-height: 200px; }

/* --- Max width --- */
.max-w-\[80\%\] { max-width: 80%; }
.max-w-\[100px\] { max-width: 100px; }
.max-w-\[120px\] { max-width: 120px; }
.max-w-\[180px\] { max-width: 180px; }

/* --- Spacing: Padding --- */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-16 { padding-bottom: 4rem; }
.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-12 { padding-right: 3rem; }
.pl-1 { padding-left: 0.25rem; }

/* --- Spacing: Margin --- */
.m-0 { margin: 0; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-14 { margin-top: 3.5rem; }
.mt-16 { margin-top: 4rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-0\.5 { margin-left: 0.125rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-6 { margin-left: 1.5rem; }
.ml-auto { margin-left: auto; }
.-ml-1 { margin-left: -0.25rem; }

/* --- Gap --- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* --- Space (vertical) --- */
.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-1\.5 > * + * { margin-top: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* --- Divide --- */
.divide-y > * + * { border-top-width: 1px; border-top-style: solid; }
.divide-gray-100 > * + * { border-top-color: #f3f4f6; }
.divide-gray-200 > * + * { border-top-color: #e5e7eb; }

/* --- Typography --- */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

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

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.italic { font-style: italic; }
.not-italic { font-style: normal; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { overflow-wrap: break-word; }
.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* --- Text sizes used in templates --- */
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; line-height: 1.4; }
.text-\[11px\] { font-size: 11px; line-height: 1.4; }

/* --- Colors: Background --- */
.bg-transparent { background-color: transparent; }
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-900 { background-color: #111827; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-indigo-700 { background-color: #4338ca; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-yellow-500 { background-color: #eab308; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }

/* Poluprozрачные фоны (модалки, хедер) */
.bg-white\/50 { background-color: rgba(255, 255, 255, 0.5); }
.bg-gray-50\/50 { background-color: rgba(249, 250, 251, 0.5); }
.bg-gray-900\/60 { background-color: rgba(17, 24, 39, 0.6); }

/* --- Colors: Text --- */
.text-white { color: #fff; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-indigo-200 { color: #c7d2fe; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-indigo-800 { color: #3730a3; }
.text-blue-500 { color: #3b82f6; }
.text-blue-700 { color: #1d4ed8; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-emerald-800 { color: #065f46; }
.text-yellow-500 { color: #eab308; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-red-800 { color: #991b1b; }

/* --- Borders --- */
.border { border-width: 1px; border-style: solid; border-color: #e5e7eb; }
.border-2 { border-width: 2px; border-style: solid; border-color: #e5e7eb; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-none { border: none; }

.border-gray-50 { border-color: #f9fafb; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-white { border-color: #fff; }
.border-indigo-100 { border-color: #e0e7ff; }
.border-blue-100 { border-color: #dbeafe; }
.border-emerald-100 { border-color: #d1fae5; }
.border-yellow-100 { border-color: #fef9c3; }
.border-red-100 { border-color: #fee2e2; }

/* --- Border Radius --- */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-2xl { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
.rounded-tr-sm { border-top-right-radius: 0.25rem; }
.rounded-tl-sm { border-top-left-radius: 0.25rem; }

/* --- Shadows --- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05); }

/* --- Backdrop --- */
.backdrop-blur {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.backdrop-blur-sm {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.backdrop-blur-md {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* --- Opacity --- */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* --- Transforms --- */
.transform { transform: translateX(0) translateY(0); }
.translate-x-full { transform: translateX(100%); }
.translate-y-full { transform: translateY(100%); }
.translate-x-0 { transform: translateX(0); }
.translate-y-0 { transform: translateY(0); }

/* --- Transitions --- */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-default { cursor: default; }

/* --- Pointer events --- */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* --- User select --- */
.select-none { user-select: none; }
.select-all { user-select: all; }

/* --- Appearance --- */
.appearance-none { -webkit-appearance: none; -moz-appearance: none; appearance: none; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }

/* --- Filter --- */
.filter { filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); }
.drop-shadow-md { --tw-drop-shadow: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06)); }

/* --- Animation --- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* --- Last child --- */
.last\:mb-0:last-child { margin-bottom: 0; }

/* ======================== */
/*  RESPONSIVE BREAKPOINTS  */
/* ======================== */

/* sm: >= 640px */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
}

/* md: >= 768px */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:flex-row { flex-direction: row; }
  .md\:flex-col { flex-direction: column; }
  .md\:hidden { display: none; }
  .md\:block { display: block; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:items-center { align-items: center; }
  .md\:items-start { align-items: flex-start; }
  .md\:items-end { align-items: flex-end; }
  .md\:justify-center { justify-content: center; }
  .md\:p-4 { padding: 1rem; }
  .md\:p-8 { padding: 2rem; }
  .md\:pb-0 { padding-bottom: 0; }
  .md\:mt-0 { margin-top: 0; }
  .md\:rounded-xl { border-radius: 0.75rem; }
  .md\:rounded-2xl { border-radius: 1rem; }
  .md\:max-h-\[600px\] { max-height: 600px; }
  .md\:max-w-\[180px\] { max-width: 180px; }
  .md\:w-80 { width: 20rem; }
  .md\:h-80 { height: 20rem; }
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:h-16 { height: 4rem; }
  .md\:gap-4 { gap: 1rem; }
  .md\:gap-6 { gap: 1.5rem; }
}

/* lg: >= 1024px */
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ======================== */
/*  FOCUS / HOVER STATES     */
/* (Tailwind generates these dynamically; provide fallbacks)  */
/* ======================== */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5); }
.focus\:ring-indigo-500:focus { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5); }
.focus\:border-indigo-500:focus { border-color: #6366f1; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-indigo-50:hover { background-color: #eef2ff; }
.hover\:bg-indigo-700:hover { background-color: #4338ca; }
.hover\:bg-indigo-100:hover { background-color: #e0e7ff; }
.hover\:bg-blue-100:hover { background-color: #dbeafe; }
.hover\:bg-emerald-200:hover { background-color: #a7f3d0; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:text-indigo-600:hover { color: #4f46e5; }
.hover\:text-indigo-700:hover { color: #4338ca; }
.hover\:text-indigo-800:hover { color: #3730a3; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:text-red-700:hover { color: #b91c1c; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:border-indigo-300:hover { border-color: #a5b4fc; }
.hover\:bg-indigo-700:hover { background-color: #4338ca; }
.hover\:bg-yellow-700:hover { background-color: #a16207; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }

/* ======================== */
/*  TOAST CONTAINER          */
/* ======================== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  margin-top: 3.5rem;
}

@media (min-width: 768px) {
  #toast-container { margin-top: 0; }
}

/* ======================== */
/*  PUSH BANNER FIX          */
/* ======================== */
#push-banner {
  transform: translateY(100%);
}
#push-banner:not(.hide) {
  transform: translateY(0);
}

/* ======================== */
/*  SAFARI / EDGE FIXES      */
/* ======================== */

/* Fix for backdrop-filter on older Edge */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .bg-white\/50 { background-color: rgba(255, 255, 255, 0.85); }
  .bg-gray-900\/60 { background-color: rgba(17, 24, 39, 0.85); }
  .backdrop-blur, .backdrop-blur-sm, .backdrop-blur-md { /* no-op */ }
}

/* iOS safe area for bottom nav */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pb-safe { padding-bottom: env(safe-area-inset-bottom); }
}

/* Prevent input zoom on iOS (font-size < 16px triggers zoom) */
@media screen and (max-width: 767px) {
  input[type="text"],
  input[type="password"],
  input[type="tel"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}
