/* Shared touch feedback, small motion and phone comfort (Android, iPhone, desktop).
   Everything here is low specificity (:where) so a screen's own rules still win. Only transform, opacity and colours animate:
   those run on the graphics chip, so they stay smooth on weak phones. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* every pressable thing answers a touch or a click */
:where(a[href],button,summary,[role=button],label[for],select){
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  transition:transform .14s cubic-bezier(.2,.8,.3,1),background-color .18s ease,border-color .18s ease,color .18s ease,opacity .18s ease;
}
:where(button,summary,[role=button]){-webkit-touch-callout:none}
:where(a[href],summary,[role=button]):active{transform:scale(.98)}
:where(button:not(:disabled)):active{transform:scale(.96)}
:where(button:disabled,[aria-disabled=true]){opacity:.55;cursor:not-allowed}
:where(input[type=checkbox],input[type=radio]){transition:transform .12s ease}
:where(input[type=checkbox],input[type=radio]):active{transform:scale(.88)}

/* a section that opens, opens softly */
:where(details[open])>:where(:not(summary)){animation:tcp-rise .22s ease-out both}
@keyframes tcp-rise{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}

/* pointer devices only (a touch screen has no hover, and iPhone keeps hover "stuck" after a tap) */
@media(hover:hover) and (pointer:fine){
  :where(a.ov-card[href],a.ov-card-link):hover{transform:translateY(-2px)}
  :where(button:not(:disabled),summary,[role=button]):hover{opacity:.92}
}

/* phones: comfortable targets, and text fields large enough that iPhone does not zoom the page when one is touched */
@media(hover:none) and (pointer:coarse){
  html body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]){font-size:16px}
  input[type=checkbox],input[type=radio]{width:24px;height:24px;min-width:24px;min-height:24px}
  :is(.remember-checkbox,.visibility-toggle,.module-permission,.language-option,.inline-check,.appearance-option){min-height:44px}
  .admin-section>summary{padding-block:10px}
}

/* iPhone with a notch, in landscape: keep content and the bottom bar out of the notch and the rounded corners */
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.bottom-bar{padding-left:calc(6px + env(safe-area-inset-left));padding-right:calc(6px + env(safe-area-inset-right))}

/* iPhone before iOS 18 needs the prefixed name for frosted backgrounds */
@supports(-webkit-backdrop-filter:blur(1px)) and (not (backdrop-filter:blur(1px))){
  @media(prefers-reduced-transparency:no-preference){
    .workspace-tabs,.bottom-bar{-webkit-backdrop-filter:blur(14px) saturate(1.4)}
  }
}

/* weak phones (little memory or few cores): keep the touch feedback, drop the decorative movement */
html.lite :where(details[open])>:where(:not(summary)){animation:none}
html.lite *{scroll-behavior:auto!important}
html.lite :is(.grow-in,.first-paint) *,html.lite :is(.ov-skel i,.skeleton span,.loading-skeleton span,.stock-skeleton>div,.stock-loading-dot){animation:none!important}
html.lite::view-transition-new(root){animation:none}
@media(prefers-reduced-motion:reduce){
  :where(a[href],button,summary,[role=button],label[for],select,input){transition:none}
  :where(a[href],summary,[role=button],button:not(:disabled)):active{transform:none}
  :where(details[open])>:where(:not(summary)){animation:none}
  a.ov-card:hover{transform:none!important}
}
