:root{--ckw-cw:min(1vw,5.6px)}

/* Browser zoom must never allow an app card or dialog to exceed the app
   column. This is deliberately desktop-only; phone and APK layouts keep
   their existing sizing. */
@media (min-width:700px) and (pointer:fine){
  html{scrollbar-gutter:stable}
  html,body{min-width:0!important;overflow-x:hidden!important}
  body>:is(.wrap,.wrapper,.page,.container,.app,main){
    min-width:0!important;box-sizing:border-box!important
  }
  :is(.topbar,.top-bar,.tbar,.userbar,.user-bar,.smart-header,.header-card){
    max-width:100%!important;box-sizing:border-box!important
  }
  :is(.modal-card,.login-card,.sheet-card,.confirm-card,.popup-card,.message-shell,
      .hint-shell,.leaderboard-panel,.cw-card,.guest-register-card,.season-review-shell,
      .cal-card,.cs-box,#ckwAboutBox){
    min-width:0!important;max-width:min(520px,calc(100vw - 32px))!important;
    box-sizing:border-box!important;margin-inline:auto!important
  }
  img,svg,canvas,video{max-width:100%}
  body,body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  input,textarea,select{user-select:text;-webkit-user-select:text}
}

html.ckw-session-closed,html.ckw-session-closed body{visibility:hidden!important}

/* Locked pages (data-lock="1" on the guard script: Hub, Profile, sign-in):
   no selecting, no long-press copy menu, no dragging pictures out, on every
   device. Typing boxes keep their text selectable so they still work. */
html.ckw-lock body,html.ckw-lock body *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
html.ckw-lock img,html.ckw-lock svg,html.ckw-lock canvas{-webkit-user-drag:none!important}
html.ckw-lock input,html.ckw-lock textarea,html.ckw-lock select,html.ckw-lock [contenteditable="true"]{-webkit-user-select:text!important;user-select:text!important}

@media print{
  html,body{display:none!important;visibility:hidden!important}
}
