/* NK Tech v3.8.4 — prevent automatic iOS Safari/PWA page zoom.
   iOS WebKit zooms the visual viewport when an input/select/textarea
   has computed font-size below 16px. Keep pinch-to-zoom accessible:
   do NOT set user-scalable=no or maximum-scale=1 in the viewport meta. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media screen and (max-width: 770px) {
  /* Guard against one wide dashboard/card changing the layout viewport
     and causing horizontal panning on iPhone. */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  #app,
  #app .main,
  #app #screen,
  #app .top,
  #app .mobile-nav-bar,
  #app .dash-home,
  #app .dash-intro,
  #app .dash-metrics,
  #app .dash-shortcuts,
  #app .dash-shortcuts-grid,
  #app .portfolio-list,
  #app .portfolio-item {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
  #app .main {
    width: 100%;
    flex: 1 1 auto;
  }
  #app .dash-metrics,
  #app .dash-shortcuts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #app .dash-metric,
  #app .dash-shortcut {
    min-width: 0;
    max-width: 100%;
  }
  #app .dash-metric-label,
  #app .dash-shortcut {
    overflow-wrap: anywhere;
  }
  #app .top-actions,
  #app .top-language {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  #app .top-language select {
    min-width: 0;
    max-width: min(150px, 100%);
  }

  /* 16px is the minimum font size preventing WebKit's input-focus zoom.
     Include authentication and dialog controls, not just the dashboard.
     Use specific mobile overrides because older styles set 11–14px. */
  #app input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  #app select,
  #app textarea,
  #auth input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  #auth select,
  #auth textarea,
  dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  dialog select,
  dialog textarea {
    font-size: 16px !important;
  }
}
