/* Android standalone shell. All rules are gated so desktop/browser UI is untouched. */
.android-install-float-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:0;
  text-decoration:none;
  background:linear-gradient(100deg,#16a34a,#0f766e 50%,#2563eb);
  color:#fff;
  cursor:pointer;
}
@media(display-mode:standalone){
  .android-install-float-btn{display:none!important}
}
html.skillo-android-app{
  width:100%;
  min-height:100%;
  background:#07131e;
  overscroll-behavior-y:contain;
}
html.skillo-android-app body{
  width:100%;
  min-height:100dvh;
  overflow-x:hidden;
  padding-top:env(safe-area-inset-top);
  padding-bottom:env(safe-area-inset-bottom);
  -webkit-tap-highlight-color:transparent;
}
html.skillo-android-app #landingAndroidInstallBtn,
html.skillo-android-app #landingDesktopInstallBtn{display:none!important}

@media(max-width:1000px){
  html.skillo-android-app #mainApp,
  html.skillo-android-app #mainApp>.container,
  html.skillo-android-app #mainApp .container{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }
  html.skillo-android-app #mainApp>.container{
    margin:0!important;
    padding:10px!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  html.skillo-android-app #mainApp :is(.tool-grid,.tools-grid,.dashboard-grid,.workspace-grid,.control-grid,.form-grid){
    min-width:0!important;
  }
  html.skillo-android-app #mainApp :is(button,.action-btn,.login-btn,.quick-qty-btn,input,select,textarea){
    min-height:44px;
    touch-action:manipulation;
  }
  html.skillo-android-app #mainApp :is(input,select,textarea){
    max-width:100%!important;
    font-size:16px!important;
  }
  html.skillo-android-app #mainApp :is(.modal,.modal-content,.dialog,.dialog-content,[role="dialog"]){
    max-width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 24px)!important;
  }
  html.skillo-android-app #mainApp :is(.preview-box,.a4-preview,.a4-sheet-preview,.pdf-preview,.canvas-wrap,.preview-container){
    max-width:100%!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  html.skillo-android-app #mainApp :is(canvas,img,video,svg){
    max-width:100%;
  }
  html.skillo-android-app #mainApp :is(.toolbar,.editor-toolbar,.pdf-editor-toolbar,.tool-actions,.action-row,.button-row){
    max-width:100%!important;
    flex-wrap:wrap!important;
  }
  html.skillo-android-app #mainApp :is(table,.data-table){
    max-width:none;
  }
  html.skillo-android-app #mainApp :is(.table-wrap,.table-responsive,.history-table-wrap){
    width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  html.skillo-android-app #mainApp.workspace-tool-focused .tab-content.active{
    min-width:0!important;
    overflow-x:hidden;
  }
}
@media(max-width:699px){
  html.skillo-android-app #mainApp :is(.tool-grid,.tools-grid,.dashboard-grid,.workspace-grid,.control-grid,.form-grid){
    grid-template-columns:minmax(0,1fr)!important;
  }
  html.skillo-android-app #mainApp :is(.action-row,.button-row,.tool-actions){
    gap:8px!important;
  }
  html.skillo-android-app #mainApp :is(.action-row,.button-row,.tool-actions)>*{
    max-width:100%;
  }
}

/* Dedicated Android update dock: it does not share the portal header or tool buttons. */
#skilloAndroidUpdateDock{
  position:fixed;
  left:50%;
  bottom:max(14px,calc(env(safe-area-inset-bottom) + 12px));
  z-index:2147483645;
  transform:translateX(-50%);
  display:none;
  width:min(92vw,390px);
  font-family:Arial,sans-serif;
  pointer-events:none;
}
#skilloAndroidUpdateDock[data-visible="true"]{display:block}
#skilloAndroidUpdateChip{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0 auto;
  min-height:44px;
  padding:9px 15px;
  border:1px solid #67e8f9;
  border-radius:999px;
  background:#071827f2;
  color:#e8fbff;
  box-shadow:0 10px 30px #0008;
  font-weight:800;
  pointer-events:auto;
  cursor:pointer;
  animation:skilloAndroidUpdatePulse 1.9s ease-in-out infinite;
}
#skilloAndroidUpdatePanel{
  display:none;
  margin:0 0 8px;
  padding:14px;
  border:1px solid #67e8f966;
  border-radius:16px;
  background:#071827f7;
  color:#e8fbff;
  box-shadow:0 16px 42px #0009;
  pointer-events:auto;
}
#skilloAndroidUpdateDock[data-open="true"] #skilloAndroidUpdatePanel{display:block}
#skilloAndroidUpdatePanel strong{display:block;margin-bottom:5px}
#skilloAndroidUpdatePanel p{margin:0 0 10px;color:#c4dce6;font-size:13px;line-height:1.45}
#skilloAndroidUpdatePanel .skillo-android-update-actions{display:flex;gap:8px}
#skilloAndroidUpdatePanel button{
  flex:1 1 0;
  min-height:42px;
  border:0;
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
}
#skilloAndroidUpdateNow{background:#22c55e;color:#052e16}
#skilloAndroidUpdateLater{background:#ffffff16;color:#e8fbff;border:1px solid #ffffff28!important}
@keyframes skilloAndroidUpdatePulse{
  0%,100%{transform:scale(1);box-shadow:0 10px 30px #0008,0 0 0 0 #22d3ee00}
  50%{transform:scale(1.025);box-shadow:0 10px 30px #0008,0 0 0 6px #22d3ee22}
}
@media(prefers-reduced-motion:reduce){
  #skilloAndroidUpdateChip{animation:none}
}


/* ===== android-mobile-button-alignment-v2 ===== */
/* Loaded after the portal/theme layers so Android standalone layout wins once,
   instead of being restyled again by older desktop-oriented cascade rules. */
@media(max-width:699px){
  html.skillo-android-app #mainApp .tab-nav{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    align-items:stretch!important;
  }
  html.skillo-android-app #mainApp .tab-nav>.tab-btn{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    justify-content:center!important;
    text-align:center!important;
  }

  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ){
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    align-items:stretch!important;
    justify-content:stretch!important;
  }
  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ) > :is(button,a,[role="button"]){
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    justify-content:center!important;
    text-align:center!important;
  }
  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ) > :only-child,
  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ) > :last-child:nth-child(odd){
    grid-column:1 / -1;
  }

  html.skillo-android-app #mainApp :is(
    .wallet-dialog-close,.utility-close-btn,.mission-x,.landing-feedback-close,
    .info-modal-close,#purchaseHistoryClose,#accountDeleteRequestClose,
    #bulkAutoManualCropClose,#bulkAutoAddMoreClose,#missionCloseBtn,#accountLocationDialogClose
  ){
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    margin:0!important;
    display:inline-grid!important;
    place-items:center!important;
    font-size:26px!important;
    line-height:1!important;
    border-radius:10px!important;
    flex:0 0 38px!important;
  }

  html.skillo-android-app #mainApp :is(.control-panel,.upload-section,.business-maker-panel,.business-preview-panel){
    min-width:0!important;
  }
}

@media(max-width:420px){
  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ){
    grid-template-columns:minmax(0,1fr)!important;
  }
  html.skillo-android-app #mainApp :is(
    .btn-group,.action-row,.button-row,.tool-actions,.business-maker-actions,
    .universal-export-panel,.workspace-strip-actions
  ) > *{
    grid-column:1!important;
  }
}

/* Update UI follows the same compact two-column mobile action rhythm. */
#skilloAndroidUpdatePanel .skillo-android-update-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
#skilloAndroidUpdatePanel .skillo-android-update-actions>button{
  width:100%;
  min-width:0;
  margin:0;
}
