/* Totem Aprovisionamento v1.2.1 — aplicado somente quando o APK oficial está em uso. */
html.op-totem-aprv,
html.op-totem-aprv body {
  margin: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.op-totem-aprv body {
  background: var(--bg, #eef7f5);
}

html.op-totem-aprv #root {
  margin: 0 !important;
  transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
}

/* Evita pequenas barras horizontais causadas por arredondamento de zoom no WebView. */
html.op-totem-aprv,
html.op-totem-aprv body {
  overflow-x: hidden !important;
}

/* Canvas de assinatura continua ocupando a largura disponível após o fit. */
html.op-totem-aprv canvas {
  max-width: 100%;
}


/* v1.2.1 — correção específica do Aprovisionamento no WebView Android.
   O transform é calculado pelo JS; estas regras eliminam qualquer largura residual. */
html.op-totem-aprv.op-totem-aprv-withdrawal,
html.op-totem-aprv.op-totem-aprv-withdrawal body {
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
}

html.op-totem-aprv.op-totem-aprv-withdrawal #root {
  transform-origin: 0 0 !important;
  -webkit-transform-origin: 0 0 !important;
}

/* Garante que componentes do Aprovisionamento nunca imponham min-width própria. */
html.op-totem-aprv.op-totem-aprv-withdrawal .provisioning-page,
html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-modern,
html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-modern > header,
html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-basics,
html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-materials,
html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-table,
html.op-totem-aprv.op-totem-aprv-withdrawal .signature-modern {
  min-width: 0 !important;
  max-width: 100% !important;
}

html.op-totem-aprv.op-totem-aprv-withdrawal .withdrawal-total {
  padding-right: 2px !important;
}


/* V41.3 · Agendar Sala não participa do auto-fit do APK. */
html.op-totem-aprv:has(body.op-native-totem[data-op-native-open="room"]),
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"]{
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  touch-action:pan-y!important;
  overscroll-behavior-y:auto!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] #root{
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  transform:none!important;
  -webkit-transform:none!important;
  zoom:1!important;
}


/* V45.7 — no Agendar Sala, o scroller oficial é .workspace > main. */
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .workspace>main{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"]{
  overflow:hidden!important;
}

/* V45.7.1 — WebView do Totem: Agendar Sala sempre rola dentro do main, independente da largura CSS do tablet. */
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell{height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace{display:flex!important;flex-direction:column!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace>.topbar{flex:0 0 86px!important;height:86px!important;min-height:86px!important}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace>main{flex:1 1 0%!important;min-height:0!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important}


/* V47.4 — fora da tela de baixa, o Totem nunca usa auto-fit: o <main> é o scroller touch. */
html.op-totem-aprv:not(.op-totem-aprv-withdrawal),
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) body{
  height:100%!important;
  max-height:100%!important;
  overflow:hidden!important;
}
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) #root,
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) .app-shell{
  width:100%!important;
  max-width:100%!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow:hidden!important;
  transform:none!important;
  -webkit-transform:none!important;
  zoom:1!important;
}
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) .app-shell>.workspace{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) .app-shell>.workspace>.topbar{
  flex:0 0 86px!important;
  height:86px!important;
  min-height:86px!important;
}
html.op-totem-aprv:not(.op-totem-aprv-withdrawal) .app-shell>.workspace>main{
  display:block!important;
  flex:1 1 0%!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
}
html.op-totem-aprv.op-totem-sap-route .app-shell>.workspace>main,
html.op-totem-aprv body.op-totem-sap-route .app-shell>.workspace>main{
  overflow-y:auto!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
}
