/* NorthStar mobile hardening — loaded last. Stops iOS focus-zoom, enlarges tap targets, fixes iOS 100vh. */
@media (max-width:760px){
  html body #app #main :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea):not(#nsm1),
  html body #main-scroll :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea):not(#nsm1):not(#nsm2),
  html body #authgate input,
  html body [role=dialog] input:not([type=checkbox]):not([type=radio]),
  html body [role=dialog] select,
  html body [role=dialog] textarea{font-size:16px !important}
  html body #app #main :is(summary,.btn-sm,.nsp-setup-hide,.nsc-x,.nsc-more,.nsx-intro-toggle):not(#nsm1){min-height:40px}
  html body .nsc-x,html body .nsc-more,html body .nsx-intro-toggle,html body .nsp-setup-hide,html body #ev-notify-contact{min-height:40px;min-width:40px}
  html body #authgate{min-height:100vh;min-height:100dvh}
  html body #nsr-panel{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px)}
  html body #ns-toasts,html body #nsp-toasts{bottom:calc(12px + env(safe-area-inset-bottom,0px)) !important}
}

/* Calendar month grid: equal columns, no blow-out from event chips (mobile) */
@media (max-width:640px){
  html body #app #main .cal-grid{gap:3px !important}
  html body #app #main .cal-nav{flex-wrap:nowrap !important;gap:6px !important}
  html body #app #main .cal-nav .section-title{font-size:15px !important;white-space:nowrap;text-align:center;min-width:0}
  html body #app #main .cal-nav .btn{white-space:nowrap;padding-left:10px;padding-right:10px}
  html body #app #main .cal-dow{font-size:11px}
  html body #app #main .cal-day{padding:3px !important;min-height:52px !important;border-radius:6px !important}
  html body #app #main .cal-day .cal-chip{font-size:9px !important;padding:1px 3px !important;margin-top:2px !important}
  html body #app #main .cal-day .cal-more{font-size:9px !important}
}
@media (max-width:480px){
  html body #app #main .cal-day{min-height:46px !important}
  /* tiny columns: show events as slim bars instead of unreadable truncated text; tap a day to see its events below */
  html body #app #main .cal-day .cal-chip{font-size:0 !important;line-height:0 !important;height:5px;padding:0 !important;border-radius:3px;min-height:0 !important}
}

/* Priority Manager rows (phone): let the row wrap so the title stays readable and every action
   button (incl. the injected "Remind me") stays on-screen instead of being clipped past the edge. */
@media (max-width:640px){
  html body #app #main .task-row[data-priority-id]{flex-wrap:wrap;align-items:flex-start}
  html body #app #main .task-row[data-priority-id] > div[style*="flex:1"]{flex:1 1 0;min-width:0}
  html body #app #main .task-row[data-priority-id] > .row{flex:1 1 100%;flex-wrap:wrap;gap:6px}
  html body #app #main .task-row[data-priority-id] > button[data-nsr-remind]{order:0;margin-left:0 !important;flex:0 0 auto}
}
