/* v47 D-TOUCH-44: on phones (viewport up to 640 px wide) every listed control receives a hit area of at least 44 x 44 CSS px
   without changing what is drawn. An empty, unpainted pseudo-element of the control (::after, or ::before where
   ::after already draws an icon or chevron) extends around the visible box; taps on it reach the control itself.
   top/bottom/left/right are min(0, 50% - 22px): a box already 44 px or larger keeps exactly its own area.
   Controls without pseudo-elements (range, select) grow an invisible padding band compensated by negative margins;
   fields inside a label use the label as their hit area. Neighbouring hit areas must not overlap
   (tests/v47_touch_targets_browser.cjs, ui_audit.cjs touch-overlap); documented spacing exceptions are marked below.
   Fine-pointer desktop keeps its density; v49 also covers coarse-pointer tablets. Inline text links inside a sentence are exempt (WCAG 2.5.8). */
@media (max-width:640px),(pointer:coarse){
  /* Controls that are not positioned yet become the containing block of their hit area (no visual change); zero
     specificity, so a control that is already absolute/fixed (visually hidden inputs, overlays) keeps its position. */
  :where(.brand,.login-card .redeem-toggle,.pager-step,.gallery-actions>button,.gallery-actions>a,.media-action-menu>summary,
    .media-action-menu>div>button,#gallery-selection-mode,.studio-player-toggle,.studio-player-sound,
    #own-password-form button,#new-user-form button:not(.help-trigger),#maintenance-toggle,#admin-audit-panel summary,
    #video-dialog-admin-actions summary,#video-dialog-admin-actions button,.menu-logout-button,.prompt-preset,
    .download-link,#session-timer,.session-menu button,.access-create-shortcut,.device-rules-toolbar>button,.user-row-actions button,
    .summary-client-link,input[type=checkbox],input[type=radio],
    .profile-media-copy,.device-policy-controls button,.profile-session button,.invite-form button,
    .admin-user-toolbar label,.guest-presence-toolbar label,.device-policy-controls label){position:relative}
  :is(.brand,.menu-toggle,.help-trigger,.login-card .redeem-toggle,.pager-step,.gallery-actions>button,
    .gallery-actions>a:not(.has-control-icon),.media-action-menu>div>button,#gallery-selection-mode,
    .studio-player-toggle,.studio-player-sound,.studio-player-fullscreen,#own-password-form button,#new-user-form button:not(.help-trigger),
    #maintenance-toggle,#admin-audit-panel summary,#video-dialog-admin-actions button,
    .menu-logout-button,.prompt-preset,#session-timer,.session-menu button,.access-create-shortcut,
    .device-rules-toolbar>button,.user-row-actions button,.summary-client-link,
    .profile-media-copy,.device-policy-controls button,.profile-session button,.invite-form button)::after,
  :is(.gallery-actions>a.has-control-icon,.media-action-menu>summary,#video-dialog-admin-actions summary,.download-link,input[type=checkbox],input[type=radio])::before{
    content:"";position:absolute;top:min(0px,calc(50% - 22px));right:min(0px,calc(50% - 22px));bottom:min(0px,calc(50% - 22px));left:min(0px,calc(50% - 22px));
    width:auto;height:auto;margin:0;padding:0;border:0;background:none;box-shadow:none;filter:none;transform:none;opacity:1}
  /* Fields without a label of their own sit in a wrapping label.tt-field (forms.css: display: contents elsewhere). */
  .tt-field{display:grid;position:relative;min-width:0}
  .tt-field:not(:has(>:not([hidden]))){display:none}
  .tt-field::after{content:"";position:absolute;top:min(0px,calc(50% - 22px));bottom:min(0px,calc(50% - 22px));left:0;right:0}
  /* Fields in a toolbar label: the label (title + field) answers taps; it reaches 3 px below the field. */
  :is(.admin-user-toolbar label,.guest-presence-toolbar label,.device-policy-controls label)::after{content:"";position:absolute;inset:0 0 -3px}
  /* Range sliders of the player: 44 px tall box, the 4 px track stays centred; margins keep the row height. */
  .studio-player-controls input[type=range]{height:44px;margin-block:-12px}
  /* Selects in a user card have no border: a 2 px transparent border band adds the missing height, the background
     stays clipped to the original box (radii keep a 9 px curve on the padding edge). */
  .user-row-actions select,.user-row-actions select:is(:hover,:focus){min-height:44px;margin-block:-2px;border-style:solid;border-color:transparent;border-width:2px 0;border-radius:var(--radius-9px)/var(--radius-11px);background-clip:padding-box}
  /* The queue filter (#job-filter) has a natural 44 px phone height (media.css, v48). */
  /* A metric label clips its overflow (ellipsis): room inside it for the help trigger's hit area. */
  .metric>span:has(>.help-trigger){padding-block:8px;margin-block:-8px}
  /* The positioned password button would paint its drop shadow over the following note: keep the note above it. */
  #own-password-form+p{position:relative}
  /* Same for the blocks below the positioned «Новое правило» button (its drop shadow stays under them as before). */
  :where(.device-rules-toolbar~*){position:relative}
  /* Where a 44 px area could not fit, the control itself has a phone layout with a natural 44 px target (v47
     addendum 4): rule chips (device-rules.css), quality pill and media filters (media.css), «Выбрать видео» (components.css) and the
     queue maintenance toggle (media.css), role/account state of a user card (admin.css). */
}
