/* =====================================
   JR TTV2 Memory Entry Layout (v0.2.1)
   Width tweak:
   - Date column = minimum (fits content)
   - Title/Description takes remaining space
   ===================================== */

/* MAIN row grid */
#ttv2-output > div[data-index].jr-ttv2-row{
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content max-content !important;
  column-gap: 22px !important;
  align-items: center !important;
}

/* LEFT column becomes its own grid: Date | Meta */
#ttv2-output > div[data-index] .jr-ttv2-left{
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important; /* Date | Meta */
  column-gap: 22px !important;
  align-items: start !important;
}

#ttv2-output > div[data-index] .jr-ttv2-date{
  color: inherit !important;
  opacity: 0.9 !important;
  white-space: nowrap !important;
  align-self: start !important;
  justify-self: start !important;
}

#ttv2-output > div[data-index] .jr-ttv2-meta{
  min-width: 0 !important;
}

#ttv2-output > div[data-index] .jr-ttv2-title strong{
  display: block !important;
  white-space: normal !important;
  word-break: break-word !important;
}

#ttv2-output > div[data-index] .jr-ttv2-desc{
  margin-top: 10px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* ACTIONS column (Edit/Delete) centered */
#ttv2-output > div[data-index] .jr-ttv2-actions{
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: end !important;
  min-width: 0 !important;
  width: max-content !important;
}

/* TEST column */
#ttv2-output > div[data-index] .jr-ttv2-test{
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  align-items: center !important;
  justify-self: end !important;
  width: max-content !important;
}

#ttv2-output > div[data-index] .jr-ttv2-test .ttv2-test-memory{
  display: inline-flex !important;
  justify-content: center !important;
}

/* HARD reset any external positioning that can break placement */
#ttv2-output > div[data-index] .bpmc-wrap{
  position: static !important;
  float: none !important;
  clear: none !important;
}

/* If a bpmc-wrap remains at row level, keep it in the right column */
#ttv2-output > div[data-index].jr-ttv2-row > .bpmc-wrap{
  grid-column: 3 !important;
  justify-self: end !important;
}

/* Counters directly under button, centered */
#ttv2-output > div[data-index] .jr-ttv2-test .bpmc-wrap{
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
  width: 100% !important;
}

#ttv2-output > div[data-index] .jr-ttv2-test .bpmc-pill,
#ttv2-output > div[data-index] .jr-ttv2-test .bpmc-badge{
  margin: 0 !important;
}

/* Responsive */
@media (max-width: 899px){
  #ttv2-output > div[data-index].jr-ttv2-row{
    grid-template-columns: 1fr !important;
    row-gap: 14px !important;
    align-items: start !important;
  }
  #ttv2-output > div[data-index] .jr-ttv2-left{
    grid-template-columns: 1fr !important;
    row-gap: 10px !important;
  }
  #ttv2-output > div[data-index] .jr-ttv2-date{
    white-space: normal !important;
  }
  #ttv2-output > div[data-index] .jr-ttv2-actions{
    flex-direction: row !important;
    gap: 12px !important;
    justify-self: start !important;
    min-width: 0 !important;
  }
  #ttv2-output > div[data-index] .jr-ttv2-test{
    justify-self: start !important;
    align-items: flex-start !important;
    width: auto !important;
  }
  #ttv2-output > div[data-index] .jr-ttv2-test .bpmc-wrap{
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    width: auto !important;
  }
}


/* Ensure section gaps are only the grid column-gap (22px) */
#ttv2-output > div[data-index] .jr-ttv2-actions,
#ttv2-output > div[data-index] .jr-ttv2-test{
  margin: 0 !important;
}
#ttv2-output > div[data-index] .ttv2-edit,
#ttv2-output > div[data-index] .ttv2-delete,
#ttv2-output > div[data-index] .ttv2-test-memory{
  margin-left: 0 !important;
  margin-right: 0 !important;
}

