/* Arkemion V19 - hotfix seguro CSS-only sobre base funcional 4.3.8 */
@media (max-width:768px){
  .ak-scene-tools,
  .ak-scene-show,
  .ak-cinematic-text-tools,
  .ak-show-text,
  #akCinematicTextTools,
  #akShowText{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  .ark-bg,
  .ark-bg-layer,
  .ark-video-bg,
  .ark-vignette,
  .ark-motion-fx{
    pointer-events:none!important;
  }

  .ark-start,
  .ark-guide,
  .ark-start button,
  .ark-guide button,
  .ark-mobile-actionbar,
  .ark-mobile-actionbar button,
  .ark-touch-menu,
  .ark-touch-menu button{
    pointer-events:auto!important;
    touch-action:manipulation;
  }

  .ark-reader{
    padding-bottom:calc(48px + env(safe-area-inset-bottom))!important;
  }

  .ark-reader-bottom{
    left:8px!important;
    right:8px!important;
    bottom:calc(48px + env(safe-area-inset-bottom))!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-end!important;
    min-height:32dvh!important;
    max-height:36dvh!important;
    z-index:54!important;
  }

  .ark-textbox{
    flex:1 1 auto!important;
    min-height:28dvh!important;
    max-height:34dvh!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding:9px 12px!important;
    border-radius:14px 14px 8px 8px!important;
    background:linear-gradient(180deg,rgba(6,7,10,.72),rgba(3,4,7,.97))!important;
    box-shadow:0 -4px 28px rgba(0,0,0,.48)!important;
  }

  .ark-textbox p{
    font-size:15px!important;
    line-height:1.46!important;
  }

  body.ak-scene-expanded .ark-reader-bottom,
  body.ak-scene-reading .ark-reader-bottom{
    min-height:40dvh!important;
    max-height:48dvh!important;
  }

  body.ak-scene-expanded .ark-textbox,
  body.ak-scene-reading .ark-textbox{
    min-height:36dvh!important;
    max-height:44dvh!important;
  }

  body.ak-scene-hidden .ark-reader-bottom{
    opacity:0!important;
    pointer-events:none!important;
    transform:translateY(14px)!important;
  }

  body.ak-scene-visual .ark-bg,
  body.ak-scene-visual .ark-bg-layer,
  body.ak-scene-visual .ark-video-bg{
    height:88dvh!important;
    top:-10dvh!important;
    object-position:center 21%!important;
  }

  body.ak-mode-visual .ark-reader-bottom{
    min-height:32dvh!important;
    max-height:36dvh!important;
  }

  body.ak-mode-visual .ark-textbox{
    min-height:28dvh!important;
    max-height:34dvh!important;
  }

  body.ak-mode-reading .ark-reader-bottom{
    min-height:42dvh!important;
    max-height:48dvh!important;
  }

  body.ak-mode-reading .ark-textbox{
    min-height:38dvh!important;
    max-height:44dvh!important;
  }

  .ark-vignette{
    background:linear-gradient(to top,rgba(0,0,0,.95) 0%,rgba(0,0,0,.62) 16%,rgba(0,0,0,.08) 49%,rgba(0,0,0,.2) 100%)!important;
  }

  .ark-mobile-actionbar{
    display:grid!important;
    left:0!important;
    right:0!important;
    width:100vw!important;
    box-sizing:border-box!important;
    grid-template-columns:minmax(48px,.78fr) minmax(76px,1.08fr) 42px 44px 48px!important;
    gap:4px!important;
    max-height:54px!important;
    padding:5px 6px calc(5px + env(safe-area-inset-bottom))!important;
    overflow:visible!important;
    z-index:1005!important;
  }

  .ark-mobile-actionbar button{
    min-width:0!important;
    min-height:38px!important;
    border-radius:11px!important;
    padding:4px 4px!important;
    font-size:9.8px!important;
    line-height:1.05!important;
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:clip!important;
  }

  .ark-mobile-actionbar button[data-ak-mobile-action="previous"],
  .ark-mobile-actionbar button[data-mobile-action="prev"]{
    order:1!important;
    font-size:10px!important;
  }

  .ark-mobile-actionbar button[data-ak-mobile-action="continue"],
  .ark-mobile-actionbar button[data-mobile-action="continue"]{
    order:2!important;
    font-size:13px!important;
  }

  .ark-mobile-actionbar button[data-ak-mobile-action="menu"],
  .ark-mobile-actionbar button[data-mobile-action="menu"]{
    order:3!important;
    font-size:0!important;
  }

  .ark-mobile-actionbar button[data-ak-mobile-action="menu"]::before,
  .ark-mobile-actionbar button[data-mobile-action="menu"]::before{
    content:"Menu";
    font-size:10px!important;
  }

  .ark-mobile-actionbar #ak438TextToggle,
  .ark-mobile-actionbar button[data-ak-438-text-toggle]{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    order:5!important;
    border-color:rgba(214,170,82,.34)!important;
    color:#f5df9b!important;
    font-size:10px!important;
  }

  .ark-mobile-actionbar #ak438VisionToggle,
  .ark-mobile-actionbar button[data-ak-438-vision-toggle]{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    order:4!important;
    border-color:rgba(173,138,255,.38)!important;
    color:#eadfff!important;
    font-size:9px!important;
  }

  .ark-mobile-actionbar button[data-ak-mobile-action="audio"],
  .ark-mobile-actionbar button[data-ak-mobile-action="narrator"],
  .ark-mobile-actionbar button[data-ak-mobile-action="notebook"],
  .ark-mobile-actionbar button[data-ak-mobile-action="fullscreen"]{
    display:none!important;
  }
}

@media (max-width:768px) and (orientation:landscape){
  .ark-reader-bottom{
    bottom:calc(50px + env(safe-area-inset-bottom))!important;
    max-height:34dvh!important;
  }

  .ark-textbox{
    max-height:28dvh!important;
  }
}
