/* Tablet / iPad adjustments */
html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
html,body{overscroll-behavior:none}
body{
  padding-left:env(safe-area-inset-left,0);padding-right:env(safe-area-inset-right,0);
  padding-bottom:env(safe-area-inset-bottom,0);
  -webkit-touch-callout:none;
}
button,.btn,select,summary,[role=button],input[type=range]{touch-action:manipulation}
/* no accidental text selection / magnifier while drawing or dragging */
#nInk,#nStage,.slide,.wave,canvas{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#nStage{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#nWrap{will-change:transform}
/* inputs at 16px stop Safari zooming the page when a field gets focus */
input,select,textarea{font-size:16px}
input[type=color]{min-width:44px;min-height:36px}

/* bigger targets for fingers and the Pencil */
@media (pointer:coarse){
  button,.btn,select{min-height:42px}
  /* round / fixed-size buttons: the 42px minimum above made them tall ovals, so size them as true circles */
  .ib,.subjMenuBtn,.nSw,.nTool,.nSizeDot,.infoBtn,.scanThumb button,.recTrack{min-height:0}
  .ib{width:42px;height:42px;min-width:42px}
  .ib.big{width:52px;height:52px;min-width:52px}
  #settingsBtn{width:44px;height:44px}
  .subjMenuBtn{width:40px!important;height:40px!important;min-width:40px!important}
  .nSw{width:30px;height:30px;min-width:30px}
  .nTool{width:42px;height:42px;min-width:42px}
  .scanThumb button{width:30px;height:30px;min-width:30px}
  .iconBtn,.tool,#settingsBtn,#plannerBtn{min-width:44px;min-height:44px}
  input[type=range]{min-height:34px}
  #settingsPanel{max-height:calc(100dvh - 80px);overflow:auto;-webkit-overflow-scrolling:touch}
}
/* install hint shown once in Safari */
#installHint{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0));z-index:9999;
  display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:14px;
  background:var(--card,#fff);color:var(--ink,#1c2430);box-shadow:0 6px 28px rgba(0,0,0,.28);font-size:15px;line-height:1.35}
#installHint button{flex:none}
@media (display-mode:standalone){#installHint{display:none}}

/* the player bar wraps on portrait iPads instead of running off the screen */
@media (max-width:1000px){
  #bar{flex-wrap:wrap}
  #waveWrap{order:9;flex:1 0 100%;width:auto}
}
