/* Responsive & Safari-specific fixes for iOS/Android */
:root{--safe-top:env(safe-area-inset-top);--safe-bottom:env(safe-area-inset-bottom)}
html,body{ -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; font-size:16px; }
body{ padding-top: calc(var(--safe-top)); padding-bottom: calc(var(--safe-bottom)); }
header.topbar, .header-mobile, .page-header{ padding-top: calc(12px + var(--safe-top)); }
.sb-bottom, .nd-footer, .footer-copy{ padding-bottom: calc(8px + var(--safe-bottom)); }

/* Ensure images scale properly on narrow viewports */
img{ max-width:100%; height:auto; display:block }

/* Prevent iOS double-tap zoom on inputs by keeping font-size >= 16px */
input, select, textarea, button, .form-control{ font-size:16px }

/* Smooth scrolling on iOS */
.app-shell, .main, .content, .page-shell, .slider-track { -webkit-overflow-scrolling: touch; }
[role="dialog"], .modal, .nd-list { -webkit-overflow-scrolling: touch; }

/* Tap highlight & touch handling */
a, button, .nav-item { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Prevent layout shift for fixed safe-area elements */
.fixed-bottom, .sb-bottom { box-sizing: border-box; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){ *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important } }

/* Small-screen adjustments */
@media (max-width: 480px){
  .logo-wordmark{ display:none }
  .task-grid{ grid-template-columns: 1fr }
}
