/* PYIFF v38 — journal vertical workspace + direct text editing */

/* Fixed journal: preview in the upper pane, all editing controls in the lower pane. */
.journal-editor-shell{
  display:flex!important;
  flex-direction:column!important;
  height:min(94vh,980px)!important;
  max-height:94vh!important;
  overflow:hidden!important;
}
.journal-editor-grid{
  flex:1 1 auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:minmax(360px,56%) minmax(260px,44%)!important;
  overflow:hidden!important;
}
.journal-editor-preview{
  order:1!important;
  min-height:0!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  touch-action:pan-x pan-y pinch-zoom!important;
  border-bottom:1px solid rgba(210,218,224,.78)!important;
}
.journal-editor-sidebar{
  order:2!important;
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  border-right:0!important;
  border-top:0!important;
}

/* Free journal: paper above, tool palette below. Both areas scroll independently. */
.v21-freeform-shell{
  display:flex!important;
  flex-direction:column!important;
  height:min(96vh,1040px)!important;
  max-height:96vh!important;
  overflow:hidden!important;
}
.v21-freeform-main{
  flex:1 1 auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:minmax(360px,56%) minmax(260px,44%)!important;
  overflow:hidden!important;
}
.v21-freeform-workarea{
  order:1!important;
  min-height:0!important;
  overflow:hidden!important;
  border-bottom:1px solid #dce3e8!important;
}
.v21-freeform-sidebar{
  order:2!important;
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  border-right:0!important;
  border-top:0!important;
}

/* Directly tap text on the paper and type; parent drag rules must not swallow the first tap. */
.v21-free-layer.is-text{
  touch-action:manipulation!important;
  user-select:text!important;
  -webkit-user-select:text!important;
  cursor:text!important;
}
.v21-text-content{
  position:relative!important;
  z-index:12!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
  user-select:text!important;
  -webkit-user-select:text!important;
  cursor:text!important;
  -webkit-tap-highlight-color:transparent!important;
}
.v21-text-content:focus{
  outline:1px dashed rgba(12,105,136,.48)!important;
  outline-offset:3px!important;
}

/* The latest collage asset is a large sheet, so give its material tile a little more room. */
.v35-sticker-tile img[src*="sticker-burst-collage"],
.v35-fixed-sticker-tile img[src*="sticker-burst-collage"]{
  object-fit:contain!important;
  background:#f4efe6!important;
}

@media(max-width:720px){
  .journal-editor-shell,.v21-freeform-shell{
    height:100dvh!important;
    max-height:100dvh!important;
    border-radius:0!important;
  }
  .journal-editor-grid{
    grid-template-rows:minmax(300px,54%) minmax(0,46%)!important;
    height:auto!important;
  }
  .v21-freeform-main{
    grid-template-rows:minmax(310px,54%) minmax(0,46%)!important;
  }
  .journal-editor-preview,.v21-freeform-workarea{
    padding-top:6px!important;
  }
  .journal-editor-sidebar,.v21-freeform-sidebar{
    padding:10px!important;
  }
  .v21-text-content{
    min-height:34px!important;
  }
}
